【解决报错】eureka微服务注册错误

2,280 阅读1分钟

eureka微服务注册之错误was unable to refresh its cache! status=Cannot execute request on any known server

问题

关键的问题描述就下面这2句来的,下面的图片应个景,我也看不懂

Request execution error. endpoint=DefaultEndpoint{serviceUrl='http://127.0.0.1:10086/eureka/},exception=java.net.ConnectException: Connection refused: connectstacktrace=com.sun.jersey.api.client.ClientHandlerException:java.net.ConnectException: Connection refused: connect

DiscoveryClient_EUREKASERVER/LAPTOP-GJ3QKVKK:eurekaserver:10086 - was unable to refresh its cache! This periodic background refresh will be retried in 30 seconds. status = Cannot execute request on any known server stacktrace = com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

image.png

image.png

image.png

解决

不出意外的话,你的eureka-server中的yml配置应该是如下图这么配的把,上图:

image.png

这就是为啥报错了,还得再加2个配置,话不多说,上图

image.png 这2个配置很关键哦,加上以后,你的报错应该解决了把,我的反正是解决了!

车修好了,springcloud继续学起来咯!