@
【轉載】原文章地址為:https://blog.csdn.net/walh131458/article/details/106075226
adminserver的bootstrap.xml配置
eureka:
instance:
hostname: 192.168.1.1
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
instance-id: 192.168.1.1:8090
prefer-ip-address: true
ip-address: 192.168.1.1
client:
serviceUrl:
defaultZone: http://192.168.1.1:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60
management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
configserver的bootstrap.xml配置
eureka:
instance:
hostname: 192.168.1.1
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
instance-id: 192.168.1.1:8080
prefer-ip-address: true
ip-address: 192.168.1.1
server:
peerEurekaNodesUpdateIntervalMs: 60000
enableSelfPreservation: false
client:
serviceUrl:
defaultZone: http://192.168.1.1:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60
management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
特別注意
instance-id: 192.168.1.1:8080
prefer-ip-address: true
ip-address: 192.168.1.1
這三個配置項需要特別注意,instance-id是客戶端注冊到eureka的地址,prefer-ip-address和ip-address是指定的地址,缺一不可。