linux 下kafka的操作命令
./bin/kafka-server-start.sh -daemon ./config/server.properties
./bin/kafka-topics.sh --create --zookeeper ip1:2181,ip2:2181,ip3:2181 --replication-factor 1 --partitions 1 --topic topic_name
./bin/kafka-topics.sh --list --zookeeper ip1:2181,ip2:2181,ip3:2181
./bin/kafka-topics.sh --describe --zookeeper ip1:2181,ip2:2181,ip3:2181 --topic topic_name
./bin/kafka-console-producer.sh --broker-list ip1:9092 --topic topic_name
./bin/kafka-console-consumer.sh --bootstrap-server ip1:9092,ip2:9092,ip3:9092 --topic topic_name
./bin/kafka-topics.sh --delete --topictopic_name ip:9092 --topic myTopic --from-beginning --group default_group
windows 下kafka的操作命令
zkserver【不要关闭】
.\bin\windows\kafka-server-start.bat .\config\server.properties【不要关闭】
.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test【不要关闭】
.\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic test【不要关闭】
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning --group default_group【不要关闭】