SpringCloud踩坑日记 - 使用ip注册到eureka


服务提供者使用主机名注册到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}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM