spring cloud unavailable-replicas

https://blog.csdn.net/u012470019/article/details/77973156

 

最主要的原因还是配置文件加载,虽然用了

java -jar eureka-server.jar --spring.profiles.active=peer1

java -jar eureka-server.jar --spring.profiles.active=peer2

分别加载不同的配置文件。

但spring仍然会加载application.properties,application.properties中的

eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
仍然对活动配置产生了影响,从而导致eureka-server不会作为服务去注册,导致高可用集群启用失败。
解决方式要么改application.properties中的值,要么每个活动配置单独变更。
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
posted @ 2019-03-08 00:43  musa  阅读(311)  评论(0编辑  收藏  举报