下載、解壓、配置環境變量
tar -zxvf kafka安裝包
vi ~/.bash_profile
export KAFKA_HOME=安裝包解壓位置
export PATH=$KAFKA_HOME/bin:$PATH
安裝kafka前提
JDK
zookeeper :https://blog.csdn.net/x670667585/article/details/103020005
進入$KAFKA_HOME/conf 目錄
修改server.properties
broker.id 如果配置多個需要設置
打開註釋
listeners=PLAINTEXT://:9092
修改kafka日誌目錄
log.dirs=創建的目錄文件夾
zookeeper.connect=localhost:2181/kafka
最後運行
kafka-server-start.sh config/server.properties
後臺運行參數 -daemon