#####################
Kafka2.x命令
#####################
kafka-topics.sh --zookeeper n11hdp01:2181,n12hdp02:2181,n13hdp03:2181/kafka --create --replication-factor 3 --partitions 3 --topic event_oper_input
kafka-topics.sh --zookeeper n11hdp01:2181,n12hdp02:2181,n13hdp03:2181/kafka --create --replication-factor 3 --partitions 3 --topic event_oper_output
kafka-topics.sh --zookeeper n11hdp01:2181,n12hdp02:2181,n13hdp03:2181/kafka --list
kafka-topics.sh --zookeeper n11hdp01:2181,n12hdp02:2181,n13hdp03:2181/kafka --delete --topic event_oper
kafka-console-producer.sh --broker-list n11hdp01:6667,n12hdp02:6667,n13hdp03:6667 --topic event_oper_input
kafka-console-consumer.sh --bootstrap-server n11hdp01:6667,n12hdp02:6667,n13hdp03:6667 --topic event_oper
kafka-console-consumer.sh --bootstrap-server n11hdp01:6667,n12hdp02:6667,n13hdp03:6667 --topic event_oper_output
kafka-topics.sh --zookeeper n11hdp01:2181,n12hdp02:2181,n13hdp03:2181/kafka --describe --topic event_oper
kafka-topics.sh --zookeeper n11hdp01:2181,n12hdp02:2181,n13hdp03:2181/kafka --alter --topic event_oper --partitions 6
#####################
Kafka3.x命令
#####################
./kafka-topics.sh --bootstrap-server 192.168.10.100:9092 --list
./kafka-topics.sh --bootstrap-server 192.168.10.100:9092 --create --replication-factor 1 --partitions 1 --topic test
./kafka-topics.sh --bootstrap-server 192.168.10.100:9092 --describe --topic test
./kafka-topics.sh --bootstrap-server 192.168.10.100:9092 --alter --topic test --partitions 3
./kafka-topics.sh --bootstrap-server 192.168.10.100:9092 --delete --topic test
./kafka-console-producer.sh --bootstrap-server 192.168.10.100:9092 --topic test
./kafka-console-consumer.sh --bootstrap-server 192.168.10.100:9092 --topic test
./kafka-console-consumer.sh --bootstrap-server 192.168.10.100:9092 --from-beginning --topic test