Kafka学习之Replication tools之Create Topic Tool

原文链接:https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools#Replicationtools-3.ListTopicTool

此工具能干啥?

如果设置auto.create.topics.enable为true,则Kafka会默认自动创建topic。会使用默认的partition数量,replication factor和Kafka的默认schema来做replica assignment。有时候我们想自定义一下,此工具帮助我们使用指定的partition数量,replication factor和replica assignment列表来创建一个topic。

 

如何使用?

bin/kafka-create-topic.sh
 
Option                                  Description
------                                  -----------
--partition <Integer: # of partitions>    number of partitions in the topic
                                          (default: 1)
 
--replica <Integer: replication factor>   replication factor for each partitions
                                          in the topic (default: 1)
 
--replica-assignment-list                 for manually assigning replicas to brokers
                                          (default: )
                                          <broker_id_for_part1_replica1 :
                                           broker_id_for_part1_replica2,
                                           broker_id_for_part2_replica1 :
                                           broker_id_for_part2_replica2, ...>
 
--topic <topic>                         REQUIRED: The topic to be created.
 
--zookeeper <urls>                      REQUIRED: The connection string for
                                          the zookeeper connection in the form
                                          host:port. Multiple URLS can be
                                          given to allow fail-over.

 

你可能感兴趣的:(kafka)