标签:replica 关闭 generate ssi fail 查询 ati current move
vim topics-to-move.json
{"topics": [{"topic": "topicA"},
{"topic": "topicB"}],
"version":1
}
bin/kafka-reassign-partitions.sh --zookeeper zk1:2181 --topics-to-move-json-file topics-to-move.json --broker-list "3,4,5" --generate
Current partition replica assignment
{"version":1,"partitions":[{"topic":"topicA","partition":2,"replicas":[0,2]},
{"topic":"topicA","partition":1,"replicas":[1,0]},
{"topic":"topicB","partition":1,"replicas":[0,1]},
{"topic":"topicA","partition":0,"replicas":[2,1]},
{"topic":"topicB","partition":0,"replicas":[2,0]},
{"topic":"topicB","partition":2,"replicas":[1,2]}]}
Proposed partition reassignment configuration
{"version":1,"partitions":[{"topic":"topicA","partition":2,"replicas":[3,4]},
{"topic":"topicA","partition":1,"replicas":[5,3]},
{"topic":"topicB","partition":1,"replicas":[3,4]},
{"topic":"topicA","partition":0,"replicas":[4,5]},
{"topic":"topicB","partition":0,"replicas":[5,3]},
{"topic":"topicB","partition":2,"replicas":[4,5]}]}
vim expand-cluster-reassignment.json
{"version":1,"partitions":[{"topic":"topicA","partition":2,"replicas":[3,4]},
{"topic":"topicA","partition":1,"replicas":[5,3]},
{"topic":"topicB","partition":1,"replicas":[3,4]},
{"topic":"topicA","partition":0,"replicas":[4,5]},
{"topic":"topicB","partition":0,"replicas":[5,3]},
{"topic":"topicB","partition":2,"replicas":[4,5]}]}
bin/kafka-reassign-partitions.sh --zookeeper zk1:2181
--reassignment-json-file expand-cluster-reassignment.json --execute
bin/kafka-reassign-partitions.sh --zookeeper zk1:2181
--reassignment-json-file expand-cluster-reassignment.json --verify
Reassignment of partition [topicA,4] is still in progress # 转移中
Reassignment of partition [topicB,2] completed successfully # 转移结束
ERROR: Assigned replicas (0,5,1,2,3,4) don‘t match the list of replicas for reassignment (5,3,4) for partition [topicA,3]
Reassignment of partition [topicA,3] failed
标签:replica 关闭 generate ssi fail 查询 ati current move
原文地址:https://www.cnblogs.com/remainsu/p/kafka-qian-yitopic.html