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

二、多機部署

 

 

 分析:

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM