Kafka创建topic:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 3 --topic test
kafka生产者
./kafka-console-producer.sh --broker-list 192.168.69.64:9092 --topic queue_command_to_device_sungrow
kafka消费者
./kafka-console-consumer.sh --zookeeper localhost:2181 --topic queue_command_to_device_sungrow
查看topic详细信息
./kafka-topics.sh --zookeeper localhost:2181 --topic sungrow_queue_protocol_r2p3 --describe
查看主题
bin/kafka-topics.sh --list --zookeeper 192.168.69.64:2181
删除主题
[root@kafka2 bin]# ./kafka-topics.sh --delete --zookeeper localhost:2181 --topic sungrow_queue_ssmerge_r2p1
Topic sungrow_queue_ssmerge_r2p1 is marked for deletion.
Note: This will have no impact if delete.topic.enable is not set to true.