解决:Getting all instance registry info from the eureka server | Connection refused: connect
启动某个应用服务,能正常启动,也能正常访问使用,但是每次都有连接失败的消息提示,抽出时间研究了下发现了原因。是因为连接eureka失败导致的错误信息:系统会在“Getting all instance registry info from the eureka server”步骤后提示:java.net.ConnectException: Connection refused: c...
·
启动某个应用服务,能正常启动,也能正常访问使用,但是每次都有连接失败的消息提示,抽出时间研究了下发现了原因。
是因为连接eureka失败导致的错误信息:
系统会在“Getting all instance registry info from the eureka server” 步骤后提示:
java.net.ConnectException: Connection refused: connect
这是注册与发现中心Eureka的prod模式配置:
spring:
application:
name: spring-cloud-demo-eureka
zipkin:
base-url: http://192.168.73.136:9411
boot:
admin:
client:
url: http://192.168.73.136:8084
server:
port: 8761
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: health,info
eureka:
instance:
hostname: host
client:
# 注册到其他的eureka服务器,生产环境集群部署必须
registerWithEureka: true
# 是否是从eureka获取注册信息,单一节点不需要,生产环境集群部署必须
fetchRegistry: true
serviceUrl:
defaultZone: http://192.168.73.136:8761/eureka/,http://192.168.73.136:8861/eureka/,http://192.168.73.136:8961/eureka/
因为Eureka是集群部署,所以应用需要在三个eureka上都注册,但是我因为练习内存吃紧,就开了一台,,重新添加内存,全部开启,问题解决。。。
Eureka docker-compose配置:
version: '3.1'
services:
spring-cloud-demo-eureka1:
restart: always
image: 192.168.73.134:5000/spring-cloud-demo-eureka
container_name: spring-cloud-demo-eureka1
ports:
- 8761:8761
networks:
- eureka-network1
spring-cloud-demo-eureka2:
restart: always
image: 192.168.73.134:5000/spring-cloud-demo-eureka
container_name: spring-cloud-demo-eureka2
ports:
- 8861:8761
networks:
- eureka-network2
spring-cloud-demo-eureka3:
restart: always
image: 192.168.73.134:5000/spring-cloud-demo-eureka
container_name: spring-cloud-demo-eureka3
ports:
- 8961:8761
networks:
- eureka-network3
networks:
eureka-network1:
eureka-network2:
eureka-network3:
更多推荐
已为社区贡献2条内容
所有评论(0)