[root@node3 opt]# /opt/kafka/bin/kafka-console-consumer.sh --zookeeper 192.168.0.117:2181,192.168.0.118:2181,192.168.0.119:2181 --from-beginning --topic test1

Exception in thread "main" org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 6000

at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880)

at org.I0Itec.zkclient.ZkClient.(ZkClient.java:98)

at org.I0Itec.zkclient.ZkClient.(ZkClient.java:84)

at kafka.consumer.ZookeeperConsumerConnector.connectZk(ZookeeperConsumerConnector.scala:156)

at kafka.consumer.ZookeeperConsumerConnector.(ZookeeperConsumerConnector.scala:114)

at kafka.consumer.ZookeeperConsumerConnector.(ZookeeperConsumerConnector.scala:128)

at kafka.consumer.Consumer$.create(ConsumerConnector.scala:89)

at kafka.consumer.ConsoleConsumer$.main(ConsoleConsumer.scala:178)

at kafka.consumer.ConsoleConsumer.main(ConsoleConsumer.scala)

我也遇到这个问题,网络确认是通的,kafka启动没有问题,创建topic,生产者连接也没有问题,消费者连接就报连接超时,请问你解决了吗?

Logo

Kafka开源项目指南提供详尽教程,助开发者掌握其架构、配置和使用,实现高效数据流管理和实时处理。它高性能、可扩展,适合日志收集和实时数据处理,通过持久化保障数据安全,是企业大数据生态系统的核心。

更多推荐