Cannot execute request on any known server或DiscoveryClient_UNKNOWN/DESKTOP-MQ8D0C9:8761

報錯信息以下:

2018-08-31 11:45:33.619 WARN 1068 --- [freshExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: java.net.ConnectException: Connection refused: connect
2018-08-31 11:45:33.619 ERROR 1068 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/admin-PC:6900 - was unable to refresh its cache! status = Cannot execute request on any known serverjava

2018-08-31 11:45:03.687 WARN 1068 --- [nfoReplicator-0] c.n.discovery.InstanceInfoReplicator : There was a problem with the instance info replicatorfetch

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known serverspa

錯誤緣由:

一、Eureka服務註冊中心也會將本身做爲客戶端來嘗試註冊它本身,因此咱們須要禁用它的客戶端註冊行爲便可。.net

二、若是你寫的是client端,註冊server服務,也有多是你註冊的服務沒有啓動形成的。code

解決方案以下:

第一種錯誤緣由,解決以下:server

在配置文件中添加以下配置:blog

eureka.client.register-with-eureka=false 
eureka.client.fetch-registry=false

第二種錯誤緣由,直接啓用server服務便可。 it

相關文章
相關標籤/搜索