博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SpringCloud问题解决:spring-cloud-eureka启动出错Cannot execute request on any known server
阅读量:2395 次
发布时间:2019-05-10

本文共 789 字,大约阅读时间需要 2 分钟。

文章目录

场景:

在启动eureka server时,出现以下错误:

com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connectcom.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

问题解决:

查看配置文件application.yml,发现register-with-eureka 属性值设置为true了,将其改为false,重启eureka服务,启动成功,问题解决

原因:

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

eureka:  instance:    hostname: localhost  client:    register-with-eureka: false    fetch-registry: false

总结:

若是未禁用eureka服务注册中心的客户端注册行为,需提供service-url注册中心地址:

server:  port: 8091eureka:  instance:    hostname: localhost  client:    register-with-eureka: true    fetch-registry: false   #注册中心地址    service-url:      defaultZone: http://${
eureka.instance.hostname}:${
server.port}/eureka/

转载地址:http://zyzob.baihongyu.com/

你可能感兴趣的文章
Differences between Tesla and a GeForce Series GPU
查看>>
Faster Parallel Reductions on Kepler
查看>>
NVIDIA Tesla C2075 vs Tesla K10 theoretical performance
查看>>
Fast floor/ceiling functions C
查看>>
Continue Long Statements on Multiple Lines Matlab
查看>>
What does “warning: not all control paths return a value” mean? (C++)
查看>>
C++ 运算符优先级
查看>>
Savitzky-Golay smoothing
查看>>
IDL get variable size in bytes
查看>>
high-frequency emphasis filter matlab
查看>>
cat -n
查看>>
使用 ftrace 调试 Linux 内核,第 2 部分
查看>>
使用 ftrace 调试 Linux 内核,第 3 部分
查看>>
内存储器管理概述、内存分配与释放、地址映射机制(mm_struct, vm_area_struct)、malloc/free 的实现
查看>>
glibc-printf
查看>>
Web--JavaWeb应用中文乱码问题原理及解决方法
查看>>
Servlet--HttpServletRequest获取请求信息(请求头、请求行、参数)详解
查看>>
Web--request解决表单参数的中文乱码问题(GET方式和POST方式)
查看>>
UML--类图详解
查看>>
Servlet--关于RequestDispatcher(forward、include)的原理
查看>>