kafka常用命令

1.查看所有topic 列表
./kafka-topics.sh --zookeeper 192.168.1.160:2181 --list
./kafka-topics.sh -list -zookeeper 192.168.1.160:2181,192.168.1.161:2181,192.168.1.162:2181

2.查看topic某分区偏移量最大(小)值
./kafka-run-class.sh kafka.tools.GetOffsetShell --topic testoffset1 --time -1 --broker-list 192.168.1.160:9092 --partitions 1

4.查看日志
./kafka-log-dirs.sh --bootstrap-server 192.168.1.160:9092 --describe --topic-list sunqi

5.查看 consumer group 列表

./kafka-consumer-groups.sh --bootstrap-server 192.168.1.160:9092 --list

6.查看 指定group

./kafka-consumer-groups.sh --bootstrap-server 192.168.1.160:9092 --group 0 --describe

./kafka-consumer-groups.sh --bootstrap-server 192.168.1.160:9092 --describe --group ucp165

4、创建消费者
./kafka-console-consumer.sh --zookeeper 192.168.1.160:2181 --topic sunqi
–from-beginning 每次都是从开始位置消费,在生产环境下不建议这样使用。

5、查看指定topic
./kafka-topics.sh --describe --zookeeper 192.168.1.160:2181 --topic testoffset1

9.topic 扩容
./bin/kafka-topics.sh --zookeeper 192.168.1.160:2181 --alter --partitions 3 --topic testoffset1

org.apache.kafka.clients.consumer.CommitFailedException: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值