spring-cloud学习BUG

1、com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect

或者com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

原因如下:

在默认设置下,Eureka服务注册中心也会将自己作为客户端来尝试注册它自己,所以我们需要禁用它的客户端注册行为。

禁止方式如下:在application.properties配置文件中增加以下内容

eureka.client.register-with-eureka= false
eureka.client.fetch-registry= false
如图所示:
重新启动即可。
 



发布了15 篇原创文章 · 获赞 1 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/u013180603/article/details/79179527