Linux下kafka “踩坑”记录--kafka.ZooKeeperClientTimeoutException: Timed out waiting for connection while in
kafka默认端口号9092,但是ZooKeeper默认端口号是2181如图错误:创建和更改主题分区时报错:kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING查看配置文件server.properties中的ZK部分发现,ZK默认端口
·
kafka默认端口号9092,但是ZooKeeper默认端口号是2181
如图错误:
创建和更改主题分区时报错:
kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
查看配置文件server.properties中的ZK部分发现,ZK默认端口号指定是2181
然而我把kafka的默认端口号9092当成ZK的去用,所以报错,新手问题。。。
将端口号修改回来后,就OK了。
如下例子,将test主题分区号修改为5个:
llw@ubuntu:/opt/kafka_2.12-2.4.0$ sudo ./bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic test --partitions 5
WARNING: If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected
Adding partitions succeeded!
查看结果:
更多推荐
已为社区贡献3条内容
所有评论(0)