下載kafka_2.10-0.10.0.0.tgz到/data/soft目錄app
進入解壓目錄(在此爲/data/app/Kafka/kafka_2.10-0.10.0.0/bin),啓動zookeeper服務。能夠在命令的結尾加個&符號,這樣服務就能夠在後臺運行code
啓動kafka服務server
kafka-server-start.sh ../config/server.properties &
ps -ef | grep kafka查看,觀察到zookeeper和kafka服務已啓動kafka
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test1234
能夠用list查看建立的topicit
kafka-topics.sh --list --zookeeper localhost:2181
kafka-console-producer.sh --broker-list localhost:9092 --topic test1234
kafka-console-consumer.sh --zookeeper localhost:2181 --topic test1234 --from-beginning