文章目录
展开
修改分区数
修改副本集数
- /usr/local/kafka/bin/kafka-reassign-partitions.sh -zookeeper 10.1.1.1:2181/kafka –reassignment-json-file /root/replication.json –execute
其中/root/replication.json文件如下:
- {
- “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
- ]
- }
- ]
- }
Thu Feb 21 16:56:13 CST 2019