kafka 备忘
创建topic
/usr/local/kafka/bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --partitions 3 --replication-factor 1 --topic test
删除topic
/usr/local/kafka/bin/kafka-topics.sh --delete --zookeeper 127.0.0.1:2181 --topic test
修改分区个数
/usr/local/kafka/bin/kafka-topics.sh --alter --zookeeper 127.0.0.1:2181 --topic dsideal_db --partitions 3
发送
/usr/local/kafka/bin/kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic test
测试接收
/usr/local/kafka/bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic test --from-beginning
查看
/usr/local/kafka/bin/kafka-topics.sh --describe --zookeeper 127.0.0.1:2181 --topic test