我见过的大多数 Eureka 客户端配置都是这样的:
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
是否可以配置备用区域,以便在默认区域失败时客户端切换到备用区域?是否可以使用 hystrix 作为断路器来切换到备用 Eureka 实例?
最佳答案
ServiceUrl 是一个 map 。每个条目都针对不同的区域(defaultZone 是默认区域)。
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
zoneA: http://localhost:8761/eureka/
zoneB: http://localhost:8761/eureka/
对于故障转移,您可以将逗号分隔的列表设置为值,例如。
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/, http://localhost:8762/eureka/
Hystrix 不是负载均衡器,因此这没有意义并且不受支持。
关于spring-cloud - 发现客户端的后备 Eureka 服务器配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41513348/