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.

相关推荐
weixin_4624462310 小时前
【实战原创】Docker 清理指南:以 Coze Studio 为例的资源保留与清理实践(非万能方案)
docker·容器·eureka
bloglin999991 天前
启动容器报错ls: cannot access ‘/docker-entrypoint-initdb.d/‘: Operation not permitted
docker·容器·eureka
学习3人组1 天前
CentOS9安装Docker
docker·容器·eureka
HillVue1 天前
中国未来 AI 路径的百度样本
大数据·eureka·dubbo
檀越剑指大厂2 天前
查看 Docker 镜像详情的几种常用方法
docker·容器·eureka
轩轩Aminent2 天前
WSL 中的 Ubuntu 系统中使用 Docker
ubuntu·docker·eureka
斯普信专业组3 天前
Docker Registry 镜像缓存与客户端无感加速(以 Docker Hub 为例)
缓存·docker·eureka
颜淡慕潇4 天前
容器生态双核心:Podman与Docker深度对比及实战指南
docker·eureka·podman
周杰伦_Jay4 天前
【大模型数据标注】核心技术与优秀开源框架
人工智能·机器学习·eureka·开源·github
凯新生物4 天前
mPEG-SS-PLGA-DTX:智能药物递送系统
eureka·flink·ffmpeg·etcd