【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
参考资料
免责声明:
本站提供的资源,都来自网络,版权争议与本站无关,所有内容及软件的文章仅限用于学习和研究目的。不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负,我们不保证内容的长久可用性,通过使用本站内容随之而来的风险与本站无关,您必须在下载后的24个小时之内,从您的电脑/手机中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。侵删请致信