【MQ】【kafka】topic 增删改差

@


写在前面

  • 相关博文
  • 个人博客首页
  • 免责声明:仅供学习交流使用!开源框架可能存在的风险和相关后果将完全由用户自行承担,本人不承担任何法律责任。

kafka

topic


// create topic
kafka-topics.sh    --command-config /tmp/client.properties        --bootstrap-server my-release-kafka.default.svc.cluster.local:19092 --create --topic test --partitions 3 --replication-factor 2
# Created topic test.
// describe topic
kafka-topics.sh    --command-config /tmp/client.properties        --bootstrap-server my-release-kafka.default.svc.cluster.local:19092 --describe --topic test

# Topic: test     TopicId: ZkKft3h8SJmFzaEdE-9h6A PartitionCount: 3       ReplicationFactor: 2    Configs: 
#        Topic: test     Partition: 0    Leader: 1       Replicas: 1,2   Isr: 1,2
#        Topic: test     Partition: 1    Leader: 2       Replicas: 2,0   Isr: 2,0
#        Topic: test     Partition: 2    Leader: 0       Replicas: 0,1   Isr: 0,1

// alter topic
kafka-topics.sh    --command-config /tmp/client.properties        --bootstrap-server my-release-kafka.default.svc.cluster.local:19092 --alter --topic test --partitions 4
# suceess update partitions 
// describe topic
kafka-topics.sh    --command-config /tmp/client.properties        --bootstrap-server my-release-kafka.default.svc.cluster.local:19092 --describe --topic test
# Topic: test     TopicId: ZkKft3h8SJmFzaEdE-9h6A PartitionCount: 4       ReplicationFactor: 2    Configs: 
#         Topic: test     Partition: 0    Leader: 1       Replicas: 1,2   Isr: 1,2
#         Topic: test     Partition: 1    Leader: 2       Replicas: 2,0   Isr: 2,0
#         Topic: test     Partition: 2    Leader: 0       Replicas: 0,1   Isr: 0,1
#         Topic: test     Partition: 3    Leader: 0       Replicas: 0,1   Isr: 0,1
// select all topic
kafka-topics.sh    --command-config /tmp/client.properties        --bootstrap-server my-release-kafka.default.svc.cluster.local:19092 --describe --topic test


参考资料


posted @ 2023-11-21 11:12  Nones  阅读(11)  评论(0编辑  收藏  举报