kafka之常⽤命令
console命令大全
#1.1 kafka启动命令
nohup bin/kafka-server-start.sh config/server.properties &
#1.2 kafka停⽌命令
bin/kafka-server-stop.sh
#1.3. kafka重启
systemctl restart kafka
#2.1 kafka-topic create 创建了⼀个名为afc_flux 的主题,3个分区,1个副本因⼦
./kafka-topics.sh --zookeeper tdh09:2181,tdh10:2181,tdh11:2181 --create --topic afc_flux --partitions 3 --replication-factor 1 #2.2 kafka删除 topic 命令
/root/TDH-Client/kafka/bin/kafka-console-topics.sh --delete --zookeeper 10.50.198.11:2181 --topic test1
#2.3查看全部的topic列表:
/root/TDH-Client/kafka/bin/kafka-console-topics.sh --list --zookeeper 10.50.198.11:2181
#2.4查看topic详情:
/root/TDH-Client/kafka/bin/kafka-console-topics.sh --describe --zookeeper 10.50.198.11:2181 --topic a05
#3.kafka⽣产命令:broker-list(21,)
/root/TDH-Client/kafka/bin/kafka-console-producer.sh --broker-list 10.50.198.21:9092 --topic a05
然后输⼊消息:例如:112233
#4.kafka消费命令:
/root/TDH-Client/kafka/bin/kafka-console-consumer.sh --bootstrap-server 10.50.198.21:9092 --topic a05 --from-beginning #5.查看topic接收的消息:
/root/TDH-Client/kafka/bin/kafka-console-consumer.sh --bootstrap-server 10.50.198.21:9092 --topic a05 --from-beginning

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。