2016年5月

之前搞定了HBase的绑定Host问题,今天在Kafka上用的时候,发现还是有问题,于是又换了一种更彻底的实现,可以直接取代之前的搞法。
本次问题表现:
[code]
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
[/code]

- 阅读剩余部分 -