Spring-Cloud Eureka Cluster

EUREKA Service Profile

1, Host file

127.0.0.1 localhost-01
127.0.0.1 localhost-02
127.0.0.1 localhost-03

2, the first service-8001 port

server:
  port: 8001
eureka:
  instance:
    hostname: localhost-01
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
     #default-zone: http://${eureka.instance.hostname}:8001/eureka/,http://${eureka.instance.hostname}:8002/eureka/
     default-zone: http://localhost-02:8002/eureka/,http://localhost-03:8003/eureka/

  server:
    enable-self-preservation: false  # Setfalse, Turn off self-protection
    eviction-interval-timer-in-ms: 4000    # Clean the interval (unit millisecond, the default is60*1000

3, the second service-8002 port

server:
  port: 8001
eureka:
  instance:
    hostname: localhost-02
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
     #default-zone: http://${eureka.instance.hostname}:8001/eureka/,http://${eureka.instance.hostname}:8002/eureka/
     default-zone: http://localhost-01:8000/eureka/,http://localhost-03:8003/eureka/

  server:
    enable-self-preservation: false  # Setfalse, Turn off self-protection
    eviction-interval-timer-in-ms: 4000    # Clean the interval (unit millisecond, the default is60*1000

4, the third service-8003 port


server:
  port: 8000
eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
     default-zone: http://${eureka.instance.hostname}:8000/eureka/,http://${eureka.instance.hostname}:8001/eureka/

  server:
    enable-self-preservation: false # Set to False, turn off self-protection
    eviction-interval-timer-in-ms: 4000  # Clean the interval (unit milliseconds, the default is 60 * 1000)

The above configuration is implemented for two or two associations

Intelligent Recommendation

The cluster - spring cloud eureka cluster code

Start two cloud clusters mycloud,mycloud1 Pom.xml adds the following configuration     <dependency>             <groupId>org.springframework.cloud&l...

Spring Cloud Eureka cluster high availability

In the microservices architecture, the registry is an essential component The registration center we built earlier is only suitable for local development. In the production environment, a cluster must...

Spring Cloud Eureka Cluster Test Report 1:

Spring Cloud Eureka Cluster Test Report 1: Foreword: Due to the limited level of younger brothers, the tests may not be perfect enough. All majors are welcome to criticize and correct. Test 1. Take up...

Spring cloud eureka build dcos cluster

2019 Unicorn Enterprise Heavy Gold Recruitment Python Engineer Standard >>> Use docker deployment service in dcos, do not use docker compose. You need to register the host ip and external por...

spring cloud Eureka registry Cluster Setup

1. Create springcloud-eureka maven project  pom.xml   2. Start class EurekaServerApplication.java   3. Create application-peer1.properties registered with peer2 registry, the registry p...

More Recommendation

Spring Cloud Netflix — Eureka Server Cluster

Foreword Eureka Server as a service registry, set up the cluster is still quite necessary, Eureka Server to build a cluster fairly simple and requires only two machines were deployed, two Eureka Serve...

Spring Cloud study notes Eureka cluster configuration

Cluster: Configure the same service on different machines to build a large computing whole Implement clusters New N Eureka Server modules Add the same dependencies as the single Eureka Server to the p...

Spring Cloud Eureka Cluster Construction Guide

Introduction Eureka is a service management module of Spring Cloud, which creates conditions for the cluster deployment of business components. Business components can be registered in the Eureka cont...

Spring-cloud creates a highly available eureka cluster

Recorded a few pits encountered during the deployment of the eureka cluster, especially the last pit. After searching on the Internet for a long time, no results were found, and I finally found myself...

Spring Cloud Eureka cluster high availability configuration

On the basis of the previous article, the simple cluster configuration of Eureka is realized to meet the requirements of high availability. Eureka's cluster logic, the difference with Zookeeper, not t...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top