1. create topic
create a topic with 3 replications:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic my-pvuv-topic
2.check topic info:
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic my-pvuv-topic
3.Producter product msg:
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my-pvuv-topic
Then at shell command, input some sentense like, press return btn:
1 zhangsan shanghai 121.78.58.1 http://www.sina.com.cn
2 lisi beijing 111.39.121.158 http://news.163.com
3 zhangsan shanghai 121.78.58.1 http://www.baidu.com
4.Consumer consume msg:
bin/kafka-console-consumer.sh –zookeeper localhost:2181 –from-beginning –topic my-pvuv-topic