存档

2016年5月 的存档

黑科技:Kafka之绑定Host问题

2016年5月20日 没有评论

之前搞定了HBase的绑定Host问题,今天在Kafka上用的时候,发现还是有问题,于是又换了一种更彻底的实现,可以直接取代之前的搞法。
本次问题表现:

Caused by: java.net.UnknownHostException: hostxxx: hostxxx
        at java.net.InetAddress.getLocalHost(InetAddress.java:1496) ~[na:1.7.0_101]
        at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:119) ~[kafka_2.10-0.8.2.2.jar!/:na]
        at kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:66) ~[kafka_2.10-0.8.2.2.jar!/:na]
        at kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:69) ~[kafka_2.10-0.8.2.2.jar!/:na]
        at kafka.consumer.Consumer$.createJavaConsumerConnector(ConsumerConnector.scala:105) ~[kafka_2.10-0.8.2.2.jar!/:na]
        at kafka.consumer.Consumer.createJavaConsumerConnector(ConsumerConnector.scala) ~[kafka_2.10-0.8.2.2.jar!/:na]
        ... 53 common frames omitted
Caused by: java.net.UnknownHostException: hostxxx
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.7.0_101]
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922) ~[na:1.7.0_101]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316) ~[na:1.7.0_101]
        at java.net.InetAddress.getLocalHost(InetAddress.java:1492) ~[na:1.7.0_101]
        ... 69 common frames omitted

更多内容…

分类: 工作 标签: , , ,