kafka安裝配置

2021-08-19 13:44:54 字數 1998 閱讀 9415

一.zookeeper部署

# tar -xvf zookeeper-3.4.6.tar.gz

# mv zookeeper-3.4.6 zookeeper

# chown -r root:root zookeeper

2.修改配置

# cd zookeeper/conf

# cp zoo_sample.cfg zoo.cfg

# vi zoo.cfg 

datadir=/usr/local/software/zookeeper/data

server.1=hadoop001:2888:3888

#mkdir data

# touch data/myid

# echo 1 > data/myid

4.啟動zookeeper

# ./zkserver.sh start

5.檢視zookeeper狀態

# ./zkserver.sh status

6.進入客戶端

# ./zkcli.sh 

[zk: localhost:2181(connected) 0] ls /

[zookeeper]

[zk: localhost:2181(connected) 1] 

[zk: localhost:2181(connected) 1] help

stat path [watch]

set path data [version]

ls path [watch]

delquota [-n|-b] path

ls2 path [watch]

setacl path acl

setquota -n|-b val path

history 

redo cmdno

printwatches on|off

delete path [version]

sync path

listquota path

rmr path

get path [watch]

create [-s] [-e] path data acl

addauth scheme auth

quit 

getacl path

close 

connect host:port

二.kafka部署

2.建立logs目錄和修改server.properties

[root@hadoop001 software]# cd kafka

[root@hadoop001 kafka]# mkdir logs

[root@hadoop001 kafka]# cd config/

[root@hadoop001 config]# vi server.properties

broker.id=1

port=9092

host.name=(自己機器id)

log.dirs=/opt/software/kafka/logs

zookeeper.connect=(自己機器id):2181/kafka

4.環境變數

[root@hadoop001 config]# vi /etc/profile

export kafka_home=/opt/software/kafka

export path=$kafka_home/bin:$path

[root@hadoop001 config]# source /etc/profile

5.啟動/停止

# nohup kafka-server-start.sh

../config/server.properties &

#這裡有坑,../不加,會導致kafka起不了。

###停止

bin/kafka-server-stop.sh

###停止

bin/kafka-server-stop.sh

【來自@若澤大資料】

Kafka安裝配置

kafka執行依賴 zookeeper,如未安裝zookeeper請參考 zookeeper安裝使用 kafka版本問題 這又是一大坑 如果你的storm安裝的是1.0.x系列或更低的版本,建議你安裝0.8.x.x版本的kafka。如果你的storm安裝的是1.1.x系列或更高的版本,建議你安裝0....

kafka安裝配置

1 部署規劃 作業系統 centos 7.2 kafka版本 kafka 2.10 0.8.2.1 安裝路徑 opt kafka 2.10 0.8.2.1 節點 192.168.20.100 105 2 部署過程 2.2 解壓 tar zxvf kafka 2.10 0.8.2.1.tgz 2.3 ...

kafka安裝配置

2 安裝成功後,啟動命令 先啟動zookeeper bin zookeeper server start.sh config zookeeper.properties 再啟動kafka bin kafka server start.sh config server.properties 3 測試ka...