Eureka的高可用解决方案

一、双机部署

Eureka系列---【Eureka如何实现高可用?】

 

 分析:

1.Eureka的server端相互注册,自动相互同步应用信息;

2.Eureka的client端注册到任意一个上面即可,但为了保险起见,我们常同时注册到两个上面,来防止client注册到server1后,server1挂掉,client重启后注册不上;

server1的配置文件:

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8762/eureka
     register-with-eureka: false

server2的配置文件:

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8761/eureka
     register-with-eureka: false

client的配置文件:

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8761/eureka,http://localhost:8762/eureka

二、多机部署

Eureka系列---【Eureka如何实现高可用?】

 

 

 分析:

1.server端两两相互注册;

2.client端同时注册到三个上面;

 

server1的配置文件:

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8762/eureka,http://localhost:8763/eureka
     register-with-eureka: false

server2的配置文件:

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8761/eureka,http://localhost:8763/eureka
     register-with-eureka: false

 

server3的配置文件:

 

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8761/eureka,http://localhost:8762/eureka
     register-with-eureka: false

client的配置文件:

eureka:
    client:
        service-url:
            defaultZone: http://localhost:8761/eureka,http://localhost:8762/eureka,http://localhost:8763/eureka

相关文章:

  • 2021-11-05
  • 2021-10-14
  • 2021-08-27
  • 2021-11-08
  • 2022-12-23
  • 2021-06-16
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2021-10-22
  • 2022-01-13
  • 2021-11-16
  • 2021-04-24
  • 2021-10-02
相关资源
相似解决方案