Eureka error "java.net.UnknownHostException: c1438e0d5866"

Posted by zhida.liao on February 1, 2016

Eureka error “java.net.UnknownHostException: c1438e0d5866”

原因

image

Eureka的客户端无法识别哈希值的主机服务程序,需要指定IP来作为识别码。

方案

在配置文件中增加以下配置:

eureka:
  instance:
    preferIpAddress: true
  client:
    serviceUrl:
      defaultZone: http://${serverA}:9761/eureka/,http://${serverA}:9762/eureka/,http://${serverA}:9763/eureka/
    registerWithEureka: true
    fetchRegistry: true