消息关闭
    暂无新消息!
[bigdata@Up2-Kafka kafka]$ $KAFKA_HOME/bin/kafka-console-consumer.sh --zookeeper 192.168.24.82:2181 --topic test2
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
[2017-07-05 11:36:58,357] ERROR Unknown error when running consumer:  (kafka.tools.ConsoleConsumer$)
java.net.UnknownHostException: Up2-Kafka: Up2-Kafka: 域名解析暂时失败
        at java.net.InetAddress.getLocalHost(InetAddress.java:1475)
        at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:132)
        at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:156)
        at kafka.consumer.Consumer$.create(ConsumerConnector.scala:109)
        at kafka.consumer.OldConsumer.<init>(BaseConsumer.scala:131)
        at kafka.tools.ConsoleConsumer$.run(ConsoleConsumer.scala:63)
        at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:50)
        at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala)
Caused by: java.net.UnknownHostException: Up2-Kafka: 域名解析暂时失败
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1295)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1471)
        ... 7 more

2个回答

︿ 0

java.net.UnknownHostException: Up2-Kafka: Up2-Kafka: 域名解析暂时失败

告诉你了找不到这台主机, 在报错的这台服务器上配置 Up2-Kafka 这个hosts IP是Up2-Kafka这台服务器的内网IP