原因:服务注册到eureka,默认使用hostname,并非IP地址。
问题:服务消费者,执行调用时候,使用hostname,调用失败。
方案:将服务注册到erreka,使用IP地址;yml配置文件参考示例如下:
eureka.instance.prefer-ip-address=true
eureka.instance.instance-id=192.168.30.153:8081
原因:服务注册到eureka,默认使用hostname,并非IP地址。
问题:服务消费者,执行调用时候,使用hostname,调用失败。
方案:将服务注册到erreka,使用IP地址;yml配置文件参考示例如下:
eureka.instance.prefer-ip-address=true
eureka.instance.instance-id=192.168.30.153:8081