kafka命令

启动kafka:
./kafka-server-start.sh ../config/server.properties &

查看topic
./kafka-topics.sh --zookeeper 192.168.8.56:2181,192.168.8.70:2181,192.168.8.147:2181 --describe --topic liuhangjun
./kafka-topics.sh --zookeeper 192.168.8.147:2181,192.168.8.56:2181,192.168.8.70:2181 --list

 

 

生产消息
./kafka-console-producer.sh --broker-list 10.166.112.149:9092 --topic test1

消费消息
./kafka-console-consumer.sh --zookeeper 192.168.8.56:2181,192.168.8.70:2181,192.168.8.147:2181 --topic liuhangjun --from-beginning

 

删除topic
./kafka-run-class.sh kafka.admin.DeleteTopicCommand --zookeeper 192.168.8.14:6831,192.168.8.15:6831,192.168.8.149:6831 --topic test

消息数量
./kafka-simple-consumer-shell.sh --broker-list 127.0.0.1:9092 --topic test --partition 0 --max-messages 1

 

posted @ 2015-12-26 10:30  Gradven  阅读(1133)  评论(0编辑  收藏  举报