启动spark
sbin/start-all.sh
停止spark
sbin/stop-all.sh
启动zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties &
启动kafka
bin/zkServer.sh start config/server.properties &
停止kafka
bin/kafka-server-stop.sh
停止zookeeper
bin/zkServer.sh stop
创建topic
bin/kafka-topics.sh --create --zookeeper master:2181 --replication-factor 1 --partitions 1 --topic test
展示topic
bin/kafka-topics.sh --list --zookeeper master:2181
描述topic
bin/kafka-topics.sh --describe --zookeeper master:2181 --topic my-replicated-topic
生产者:
bin/kafka-console-producer.sh --broker-list master:9092 --topic my-replicated-topic
消费者:
bin/kafka-console-consumer.sh --zookeeper master:2181 --topic test --from-beginnin