1. 程式人生 > >SpringCloud踩坑日記 (1) - 使用ip註冊到eureka

SpringCloud踩坑日記 (1) - 使用ip註冊到eureka

pre true key值 pad 取ip fault ins default instance

服務提供者使用主機名註冊到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}

SpringCloud踩坑日記 (1) - 使用ip註冊到eureka