##kafka常用命令
在launcher上,cd /usr/local/kafka_2.11-0.9.0.0/bin
查看topic的list
./kafka-topics.sh --zookeeper 192.168.1.60:2181,192.168.1.61:2181,192.168.1.62:2181 --list
查看具体topic的信息
./kafka-topics.sh --zookeeper 192.168.1.60:2181,192.168.1.61:2181,192.168.1.62:2181 --describe --topic report-ad
查看具体topic当前消费的实时流
./kafka-console-consumer.sh --zookeeper 192.168.1.60:2181,192.168.1.61:2181,192.168.1.62:2181 --topic report-ad
创建新的topic
./kafka-topics.sh --create --zookeeper 192.168.1.60:2181,192.168.1.61:2181,192.168.1.62:2181 --replication-factor 2 --partitions 18 --topic impression-reformat-part
修改topic
./kafka-topics.sh --zookeeper 192.168.1.60:2181,192.168.1.61:2181,192.168.1.62:2181 --alter --topic extend-event-reformat --replica 2 --partitions 18
往指定topic中灌入数据
cat impression_reformat.list|./kafka-console-producer.sh --broker-list 192.168.1.60:9092,192.168.1.61:9092,192.168.1.62:9092 --topic article-gmp
查看指定group的消费情况
./kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --group reformat-click --zookeeper 192.168.1.60:2181,192.168.1.61:2181,192.168.1.62:2181
指定group消费数据
./kafka-console-consumer.sh --consumer.config <config file>