bin/zookeeper-server-start.sh config/zookeeper.properties & //启动zookeeper服务
bin/kafka-server-start.sh config/server.properties &
创建topic
bin/kafka-topics.sh --create --zookeeper 172.18.90.51:2181 --replication-factor 3 --partitions 1 --topic test22
列出topic
bin/kafka-topics.sh --zookeeper 172.18.90.51:2181 --list
查看topic详细信息
bin/kafka-topics.sh --describe --zookeeper 172.18.90.51:2181
发送消息
bin/kafka-console-producer.sh --broker-list 172.18.90.51:9092 --topic test22
接收消息
bin/kafka-console-consumer.sh --zookeeper 172.18.90.51:2181 --topic test22 --from-beginning
bin/kafka-server-start.sh config/server.properties &
创建topic
bin/kafka-topics.sh --create --zookeeper 172.18.90.51:2181 --replication-factor 3 --partitions 1 --topic test22
列出topic
bin/kafka-topics.sh --zookeeper 172.18.90.51:2181 --list
查看topic详细信息
bin/kafka-topics.sh --describe --zookeeper 172.18.90.51:2181
发送消息
bin/kafka-console-producer.sh --broker-list 172.18.90.51:9092 --topic test22
接收消息
bin/kafka-console-consumer.sh --zookeeper 172.18.90.51:2181 --topic test22 --from-beginning