【发布时间】:2020-07-09 08:51:21
【问题描述】:
clientui 使用来自 3 个微服务的数据为网页提供服务。
我成功设置了功能区以在 2 个“微服务产品”实例之间进行负载平衡。当我在 clientui 的 application.properties 中有这行 microservice-produits.ribbon.listOfServers=localhost:9001,localhost:9011 时,它可以工作。
现在我想让它工作,而不必对微服务 url 进行硬编码。
这是我尝试过的:
应用类:
和 pom (clientui):
按照这些答案 (Load balancer does not have available server for client):
我尝试在 application.properties 中添加 fetchRegistry 行,并在 (clientui) pom.xml 中添加/删除 netflix-eureka-client 和 netflix-eureka-server 依赖项
那么:有什么想法吗??
【问题讨论】:
-
客户端 ui 应该有 eureka client starter no server
-
是的,我都试过了
标签: spring-cloud netflix-eureka netflix-ribbon