Unable to connect to zookeeper server within timeout: 6000

1.启动zookeeper
2.启动kafka
3.启动kafka-producer
4.启动kafka-consumer
5.生产一些消息
6.kafka-consumer窗口报错

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

解决办法:
修改$ZK_HOME/conf/zoo.cfg,不要使用hostname,直接使用IP

《Unable to connect to zookeeper server within timeout: 6000》 image.png

    原文作者:sparkle123
    原文地址: https://www.jianshu.com/p/064090d39a99
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞