标签:xxx replica consumer begin partition 示例 帮助 OLE star
-- kafka路径示例
/opt/cloudera/parcels/KAFKA/bin
-- kafka启动
./kafka-server-start.sh -daemon ../config/server.properties
-- 帮助信息
kafka-topics --help
-- 查看topic
kafka-topics --list -zookeeper hadoop02:9092,hadoop03:9092,hadoop04:9092 --topic MQ_TN_BIG_DATA_CALL_API_MSG_XXX_XXX
-- 查看topc结构
kafka-topics --describe -zookeeper hadoop02:9092,hadoop03:9092,hadoop04:9092 --topic MQ_TN_BIG_DATA_CALL_API_MSG_XXX_XXX
-- 创建topic 2个分区,2个副本
bin/kafka-topics.sh --create --zookeeper hadoop02:9092,hadoop03:9092,hadoop04:9092 --replication-factor 2 --partitions 2 --topic test
-- 生产消息
kafka-console-producer.sh --broker-list hadoop02:9092,hadoop03:9092,hadoop04:9092 --topic MQ_TN_BIG_DATA_CALL_API_MSG_XXX_XXX
-- 消费消息
kafka-console-consumer.sh -zookeeper hadoop02:9092,hadoop03:9092,hadoop04:9092 --from-beginning --topic MQ_TN_BIG_DATA_CALL_API_MSG_XXX_XXX
-- 为topic增加partition.
kafka-topics.sh –zookeeper hadoop02:9092,hadoop03:9092,hadoop04:9092 –alter –partitions 3 –topic MQ_TN_BIG_DATA_CALL_API_MSG_XXX_XXX
标签:xxx replica consumer begin partition 示例 帮助 OLE star
原文地址:https://www.cnblogs.com/amberly/p/10249063.html