Eureka的集群配置
Posted dalianpai
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Eureka的集群配置相关的知识,希望对你有一定的参考价值。
修改配置
spring: application: name: eureka-server server: port: 7010 eureka: instance: hostname: eureka7010.com client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://eureka8010.com:8010/eureka/,http://eureka9010.com:9010/eureka/
spring: application: name: eureka-server server: port: 8010 eureka: instance: hostname: eureka8010.com client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://eureka7010.com:7010/eureka/,http://eureka9010.com:9010/eureka/
spring: application: name: eureka-server server: port: 9010 eureka: instance: hostname: eureka9010.com client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://eureka8010.com:8010/eureka/,http://eureka7010.com:7010/eureka/
修改hosts配置文件
127.0.0.1 eureka7010.com 127.0.0.1 eureka8010.com 127.0.0.1 eureka9010.com
把3个配置全部开启
查看页面
高可用
配置成高可用的话,把2个false注释就行
接着修改注册服务的配置
会发现每个节点里面都有注册的信息(下图为7010的,实际注册到8010的)
以上是关于Eureka的集群配置的主要内容,如果未能解决你的问题,请参考以下文章