How to create a topic on Kafka

Script manually created

./bin/kafka-topics.sh –zookeeper 192.168.2.225:2183/config/mobile/mq –create –topic test.example –replication-factor 2 –partitions 24 
–topic specifies topic name 
–partitions specifies the number of partitions, this parameter It needs to be determined according to the number of brokers and the amount of data. Under normal circumstances, two partitions on each broker are the best; 
–replication-factor specifies the number of replicas for the partition, and it is recommended to set it to 2;

The program is automatically created:

Enable automatic creation of configuration: auto.create.topics.enable=true 
The program sends data directly to the corresponding topic in kafka. If the topic does not exist, it will be created according to the default configuration.

 

 

rocketmq   autoCreateTopicEnable

 

 

http://blog.csdn.net/lizhitao/article/details/45894189

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326622805&siteId=291194637