您好,登錄后才能下訂單哦!
一.安裝zookeeper
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.5.6/apache-zookeeper-3.5.6-bin.tar.gz
tar -zxvf apache-zookeeper-3.5.6-bin.tar.gz
cd apache-zookeeper-3.5.6-bin
啟動zookeeper
cp zoo_sample.cfg zoo.cfg
bin/zkServer.sh start
驗證
ps -ef | grep zoo
二.安裝kafka
http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
tar -zxvf kafka_2.12-2.3.0.tgz
cd kafka_2.12-2.3.0
cp config/zookeeper.properties config/zookeeper.properties.bak
修改config這四項
broker.id=1
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://host_ip:9092
log.dirs=/tmp/kafka/logs-1
啟動kafka
bin/kafka-server-start.sh config/server.properties
驗證
ps -ef | grep kafka
三.驗證zookeeper 是否注冊了kafka
cd apache-zookeeper-3.5.6-bin
bin/zkCli.sh
[zk: localhost:2181(CONNECTED) 0] ls /brokers/ids
如果為空,重新啟動kafka
四.創建topic | 查看topic
cd kafka_2.12-2.3.0
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。