Spe*_* A1 3 spring-boot spring-cloud netflix-eureka spring-cloud-netflix
我有一个 Spring Boot Eureka 服务器应用程序,它被配置为在端口 5000 而不是默认的 8761 端口中运行。但是,当我运行 SBA 时,在监听 localhost:8761 时,我在控制台上收到了一些与 java 连接被拒绝相关的错误
信息 10408 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient :从尤里卡服务器获取所有实例注册信息错误 10408 --- [tbeatExecutor-0] cndstdRedirectingEurekaHttpClient :请求执行错误。endpoint=DefaultEndpoint{ serviceUrl=' http://localhost:8761/eureka/ }
com.sun.jersey.api.client.ClientHandlerException:java.net.ConnectException:连接被拒绝:连接在 com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4 -1.19.1.jar:1.19.1]
稍后当我启动其他微服务时,我可以看到它们在 eureka 中正确注册并在端口 5000 上运行。但是为什么应用程序在启动 Eureka 服务器时会忽略配置?
同样从嵌入的图片中可以明显看出,服务器正在 8761 中寻找已注册和不可用的副本。
将非常感谢对此的任何解释。
Spe*_* A1 10
Even after adding the registerWithEureka & fetchRegistry to false, it was still pointing to 8761 for replica url.
eureka.client.registerWithEureka = false
eureka.client.fetchRegistry = false
Run Code Online (Sandbox Code Playgroud)
The root cause of the problem was not actually setting the self register/search registry properties to be false, but also to modify/specify the correct serviceUrl property.
Added the following lines to the application.properties and now my Eureka server doesn't point to the default Eureka port of 8761 for registered replica url.
eureka.client.serviceUrl.defaultZone: http://localhost:${server.port}/eureka/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4577 次 |
| 最近记录: |