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_第1张图片
image.png

你可能感兴趣的:(Unable to connect to zookeeper server within timeout: 6000)