I/O error on GET request for "http://": ; nested exception is java.net.UnknownHostException:

在学习springcloud的使用使用consumer远程调用Eureka中的服务 在本地调用没有问题 ,但是部署到linux系统上访问就一直报错

org.springframework.security.authentication.InternalAuthenticationServiceException: I/O error on GET request for "http://LOGINPROVIDER/checkAccount/123": 8d3b6ac52aaa; nested exception is java.net.UnknownHostException: 8d3b6ac52aaa

请求的URL地址错误,找不到访问的主机。

LOGINPROVIDER到底是你的服务名,还是自己window配置了host文件
服务名的话,负载均衡会给你自己去选择服务实例,那这就有意思了;如果是host文件,那就是你的问题了

java.net.UnknownHostException: 8d3b6ac52aaa
后面的8d3b6ac52aaa是你的docker镜像id吧,
Eureka注册的时候,选择用你的IP地址注册,不用docker的镜像ID注册。

参考
https://stackoverflow.com/questions/28202611/can-i-force-eureka-registrations-to-use-an-ip-address-instead-of-a-hostname