|
修改分区数
[ol]/usr/local/kafka/bin/kafka-topics.sh --alter --zookeeper 10.1.1.1:2181/kafka --topic hogtmoperation --partitions 5[/ol]复制代码
修改副本集数
[ol]/usr/local/kafka/bin/kafka-reassign-partitions.sh -zookeeper 10.1.1.1:2181/kafka --reassignment-json-file /root/replication.json --execute[/ol]复制代码
其中/root/replication.json文件如下:
[ol]{ "version": 1, "partitions": [ { "topic": "hogtmoperation", "partition": 0, "replicas": [ 2, 1 ] }, { "topic": "hogtmoperation", "partition": 1, "replicas": [ 3, 2 ] }, { "topic": "hogtmoperation", "partition": 2, "replicas": [ 4, 3 ] }, { "topic": "hogtmoperation", "partition": 3, "replicas": [ 5, 4 ] }, { "topic": "hogtmoperation", "partition": 4, "replicas": [ 6, 5 ] } ]}[/ol]复制代码 |
|