2017-03-08 hadoop►kafka►kafka use kafka use kafka 常用命令1234567891011121314151617//查看topicbin/kafka-topics.sh --zookeeper localhost:2181 --list//创建3个副本的topicbin/kafka-topics.sh --zookeeper localhost:2181 --create --replication-factor 3 --partitions 1 --topic my-replicated-topic//查看topic状态bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic my-replicated-topic//删除topicbin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic my-replicated-topic//发送数据bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my-replicated-topic//消费数据bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my-replicated-topic --from-beginning 1234567//查看当前消费者是否已经读到最新的数据[wisdom@10 ~]$ /mnt/app/kafka/bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --group Booking --zookeeper 10.0.3.65:2181 --topic Booking[2017-03-17 14:35:48,094] WARN WARNING: ConsumerOffsetChecker is deprecated and will be dropped in releases following 0.9.0. Use ConsumerGroupCommand instead. (kafka.tools.ConsumerOffsetChecker$) Group Topic Pid Offset logSize Lag Owner Booking Booking 0 101 166 65 Booking_470_636253289830976972-0 Booking Booking 1 97 167 70 Booking_470_636253289830976972-0 Newer kafka add topic partitions Older kafka info