服務提供者使用主機名注冊到eureka改為使用ip注冊到eureka
eureka:
client:
service-url:
defaultZone: http://localhost:10010/eureka/
instance:
preferIpAddress : true
instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
其中獲取ip,SpringCloud2.0版本對應的key值為${spring.cloud.clent.ip-address},網上流傳大多為${spring.cloud.clent.ipAddress}