1.查看所有topic
[root@server kafka]$ ./bin/kafka-topics.sh -zookeeper 192.168.0.217:2181 --list
2.0.8.x版本创建topic
[root@server kafka]# ./bin/kafka-topics.sh --create --zookeeper 192.168.0.217:2181 --replication-factor 2 --partitions 1 --topic domain-change
2.发送消息
[root@serverkafka]# ./bin/kafka-console-producer.sh --broker-list 192.168.0.212:9092 --topic test
3.接收信息(0.8.x版本)
[root@server kafka]# ./bin/kafka-console-consumer.sh --zookeeper 192.168.0.217:2181 --topic test --from-beginning