eureka can not obtain the correct public network ip Ali server

Individual servers, such as virtual servers, many gateway card to do a lot or a lot of mapping virtual network card,

Easily lead to eureka client can not get to the correct public network ip address, easier direct access to the LAN IP,

Resulting in less than a eureka service registration server

This case, the public network ip corresponding services write fixed in the configuration file

Configuration is as follows:

# Using IP access registry (set when the production environment is true) eureka.instance.prefer-ip-address: true # display format at the time of registration center status, here is the ip: port eureka.instance.instance-id: $ spring.cloud.client.ipAddress} {:} $ {the server.port 
eureka.instance hostname:. $ {#} spring.cloud.client.ipAddress written to the fixed point ip eureka for eureka not available on the server lead to the correct ip registration invalid # eureka.instance.ip-address: 113.120.4.29 from: www.1b23.com

This place, plus a

 eureka.instance.ip-address:113.120.4.29

 This Ip according to the actual public ip address of the corresponding service, not eureka Ip server, client ip, the place to registration center ip is the IP eureka service, this place, do not confused


Guess you like

Origin blog.51cto.com/14622073/2452513