eureka ConnectException如何解决

最近开始学习微服务,配置了一个超级简单的eureka,居然频繁报错无法启动,总是报ConnectException,踩了不少坑,因此记录一下。

  • 未解决】一种典型的做法是配置一个WebSecurityConfig,把某些安全策略关掉,未果。
  • 已解决 】另一种做法是在application.yml配置里面禁止eureka client注册自己,将fetchRegistryregisterWithEureka设置为false。
yml 复制代码
# application.yml
eureka:
  client:
    fetchRegistry: 'false'
    registerWithEureka: 'false'

Reference:
https://stackoverflow.com/questions/56114871/cannot-connect-to-eureka-server-exception-java-net-connectexception-connectio

Explanation:

We're telling the built-in Eureka Client not to register with itself because our application should be acting as a server.

The reason behind this error is Eureka client is trying to register and fetch information with Eureka server. This happens because of bean auto configuration feature in spring Boot. As you are deploying the Eureka server you don't need want to register with yourself. That's why we are disabling.

相关推荐
斯普信专业组1 天前
Eureka故障处理大汇总
云原生·eureka
奥格列的魔法拖鞋~1 天前
Docker-LNMP架构 创建多项目- 单个ngixn代理多个PHP容器服务
nginx·docker·eureka·架构·php·lnmp
江湖有缘2 天前
【Docker项目实战】使用Docker部署Vikunja任务管理工具
docker·容器·eureka
江湖有缘3 天前
【Docker项目实战】使用Docker部署todo任务管理器
docker·容器·eureka
liliangcsdn3 天前
Mac M1探索AnythingLLM+SearXNG
人工智能·docker·云原生·eureka
会飞的胖达喵4 天前
docker network 与host的区别
docker·eureka·php
独行soc4 天前
2025年渗透测试面试题总结-15(题目+回答)
python·科技·docker·容器·面试·eureka
AI风老师7 天前
5、docker镜像管理命令
java·docker·eureka
沐霜枫叶7 天前
如何 让ubuntu 在root 下安装的docker 在 普通用户下也能用
ubuntu·docker·eureka
hadage2338 天前
--- Eureka 服务注册发现 ---
云原生·eureka