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 server

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

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

错误原因:

1、Eureka服务注册中心也会将自己作为客户端来尝试注册它自己,所以我们需要禁用它的客户端注册行为即可。

2、如果你写的是client端,注册server服务,也有可能是你注册的服务没有启动造成的。

解决方案如下:

第一种错误原因,解决如下:

在配置文件中添加如下配置:

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

第二种错误原因,直接启用server服务即可。 

 

转载于:https://www.cnblogs.com/mmzs/p/9565183.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值