Adding a new partition Kafka 0.8.1.1 -
for particular topic want have 1 partition per broker. thought scale maintain on adding brokers. however, when test out how new partitions added not work in way expect. example, have 3 brokers: 2064029428, 2064029280, 2064028458. create new topic:
/opt/kafka/bin/kafka-topics.sh --create --zookeeper zk.net:2181/stream --topic test --partitions 2 --replication-factor 1 /opt/kafka/bin/kafka-topics.sh --describe --zookeeper zk.net:2181/stream --topic test topic:test partitioncount:2 replicationfactor:1 configs: topic: test partition: 0 leader: 2064029428 replicas: 2064029428 isr: 2064029428 topic: test partition: 1 leader: 2064028458 replicas: 2064028458 isr: 2064028458
i alter topic add together partition.
/opt/kafka/bin/kafka-topics.sh --alter --zookeeper zk.net:2181/stream --topic test --partitions 3 /opt/kafka/bin/kafka-topics.sh --describe --zookeeper zk.net:2181/stream --topic test topic:test partitioncount:3 replicationfactor:1 configs: topic: test partition: 0 leader: 2064029428 replicas: 2064029428 isr: 2064029428 topic: test partition: 1 leader: 2064028458 replicas: 2064028458 isr: 2064028458 topic: test partition: 2 leader: 2064029428 replicas: 2064029428 isr: 2064029428
i have expected new partition have been created on broker 2064029280 since not have partition. instead 2 partitions on same broker 2064029428. expected? there way command new partition added? tried --replica-assignment
option, works when creating topic, doesn't not work when altering topic.
as noted in kafka doc, have manually trigger reassignment.
in 0.8.1, partition reassignment tool not have capability automatically study info distribution in kafka cluster , move partitions around attain load distribution. such, admin has figure out topics or partitions should moved around.
in short have utilize bin/kafka-reassign-partitions.sh
tool manually crafted migration plan.
see guide on manual reassignment more.
apache-kafka
No comments:
Post a Comment