标签:server ons rom nbsp tst list replica trap zha
启动kafka自带的zookeeper
./bin/zookeeper-server-start.sh config/zookeeper.properties &
启动kafka
./bin/kafka-server-start.sh config/server.properties
创建一个叫做“test”的topic,它只有一个分区,一个副本。
./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
查看创建的topic
./bin/kafka-topics.sh --list --zookeeper localhost:2181
发送消息
./bin/kafka-console-producer.sh --broker-list 192.168.137.128:9092 --topic test
接受消息
./bin/kafka-console-consumer.sh --bootstrap-server 192.168.137.128:9092 --topic test --from-beginning
{"id":"b18a865a-fe8d-465d-bc67-865e51e348cd","msg":"zhangxianlong,mawanqiu","sendTime":"2018-09-25 09:57:51"}
标签:server ons rom nbsp tst list replica trap zha
原文地址:https://www.cnblogs.com/ixan/p/9903570.html