是指手动写扩充replicas的配置文件,然后使用工具进行操作。

   参考官网site:http://kafka.apache.org/documentation.html#basic_ops_automigrate

  1.首先创建一个三分区一副本的topic,并查看详细信息:

     

  2.修改配置文件

    将原有replicas为[0]扩充为[0,1], [1]扩充为[1,2],[2]扩充为[2,0,1] 

    > cat partitions-to-move.json

    

  3.执行操作,并检查修改情况

    > bin/kafka-reassign-partitions.sh --zookeeper h1:2181 --reassignment-json-file partitions-to-move.json --execute

    > bin/kafka-topics.sh --describe --zookeeper h1:2181  --topic test-add-replication-topic

    

    由于太长,只截取了部分信息

  

  

posted on 2016-01-11 14:21  一寸相思万千劫  阅读(4506)  评论(0编辑  收藏  举报