kafka0.10.0單機測試

剛開始折騰kafka,單機版測試成功 單機版很簡單,按照文檔下載執行即可

前提是安裝好java 配置好環境變量

  1. 從kafka站點下載最新的kafka

  2. 解壓到執行目錄

  3. 啓動zookeeper 服務 bin/zookeeper-server-start.sh config/zookeeper.properties

  4. 啓動kafka服務 bin/kafka-server-start.sh config/server.properties

  5. 創建topic bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

  6. 查看創建的topic  bin/kafka-topics.sh --list --zookeeper localhost:2181

  7. 生產消息併發送到服務端 bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

  8. 在消費端查看消息 bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning

wKiom1dXge-Q8ZpnAAS1nzz7CII996.jpg-wh_50

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章