Kafka Centos7環境搭建
1. 安裝Zookeeper
1.1 官網下載安裝包
ZooKeeper官網下載地址
1.2 使用Xftp或遠端工具將ZooKeeper安裝包上傳檔案到伺服器或虛擬機器
1.3 編寫配置檔案
進入ZooKeeper安裝目錄
cd {安裝目錄}/conf/
1.3.1 配置檔案模版
# 使用Vim編輯
vim
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
admin.serverPort=8084 # 8080埠占用可修改
1.3.2 啟動命令
# 進入bin目錄
cd {安裝目錄}/bin
# 啟動
./zkServer.sh start
1.3.3 測試是否安裝成功
# 進入bin目錄
cd {安裝目錄}/bin
# 啟動測試
./zkCli.sh
測試成功截圖
2. 官網下載最新kafka包
Kafka官網下載地址
3. 使用Xftp或遠端工具將Kafka安裝包上傳檔案到伺服器或虛擬機器
4. 啟動Kafka
# 進入安裝目錄
cd 安裝目錄
# 啟動kafka
./bin/kafka-server-start.sh {安裝目錄}/config/server.properties