kafka 常用命令
#1.1 kafka 启动命令 nohup bin/kafka-server-start.sh config/server.properties .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,22,23....)/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
评论