kafka 2 11 0 10 2 0集群安裝

2021-08-19 05:41:07 字數 3605 閱讀 9502

集群環境:

spark1 ip:192.168.6.137

spark2 ip:192.168.6.138

spark3 ip:192.168.6.139

$ cd /usr/local

$ wget

/kafka/

0.10.2.0/kafka_2.11-0.10.2.0.tgz

$ tar -xzf kafka_2.11-0.10.2.0.tgz

$ cd kafka_2.11-0.10.2.0

spark1

broker.id=1

listeners=plaintext:

.6.137:9092

advertised.listeners=plaintext:

.6.137:9092

log.dirs=/usr/local/kafka_2.11-0.10

.2.1/log/kafka

num.partitions=3

zookeeper.connect=192.168

.6.137:2181,192.168

.6.138:2181,192.168

.6.139:2181

spark2

broker.id=2

listeners=plaintext:

.6.138:9092

advertised.listeners=plaintext:

.6.138:9092

log.dirs=/usr/local/kafka_2.11-0.10

.2.1/log/kafka

num.partitions=3

zookeeper.connect=192.168

.6.137:2181,192.168

.6.138:2181,192.168

.6.139:2181

spark3

broker.id=3

listeners=plaintext:

.6.139:9092

advertised.listeners=plaintext:

.6.139:9092

log.dirs=/usr/local/kafka_2.11-0.10

.2.1/log/kafka

num.partitions=3

zookeeper.connect=192.168

.6.137:2181,192.168

.6.138:2181,192.168

.6.139:2181

spark1、spark2、spark3

datadir=/usr/local/kafka_2.11-0.10.2.1/zookeeper

datalogdir=/usr/local/kafka_2.11-0.10.2.1/log/zookeeper

clientport=2181

maxclientcnxns=100

ticktime=2000

initlimit=10

synclimit=5

server.1=spark1:2888:3888

server.2=spark2:2888:3888

server.3=spark3:2888:3888

分別在3臺伺服器的/usr/local/kafka_2.11-0.10.2.1/zookeeper目錄中新建乙個myid的檔案,裡面存當前zookeeper的pid:

spark1

echo

"1" >myid

spark2

echo

"2" >myid

spark1

echo

"2" >myid

$ $kafka_home/bin/zookeeper-server

-start

.sh -daemon

$kafka_home/config/zookeeper.properties

$ $kafka_home/bin/kafka-server

-start

.sh -daemon

$kafka_home/config/server.properties

$ cd /usr/local

$ wget

/native-packages/sbt

/0.13.15/sbt-0.13.15.tgz

$ tar -zxvf sbt-0.13.15.tgz

$ export sbt_home=/home1/irteam

$ export path=$sbt_home/bin:

$path

$ sbt sbt-version (用於測試是否成功,需要等一會)

$ git clone 

$ cd kafka-manager

/$ sbt clean dist (執行後需要等很久...)

$ cd target/universal/(進入後會發現多了乙個kafka-manager

-1.3

.3.7

.zip,這是編譯生成的)

$ mkdir kafka-manager

-web

-1.3

.3.7

.zip kafka-manager

-web

$ cd kafka-manager

-web

$ unzip kafka-manager

-1.3

.3.7

.zip

$ rm -f kafka-manager

-1.3

.3.7

.zip (刪除zip包)

&

在位址列中輸入http:.6.137:8888訪問即可

kafka 2 11 0 11 0 1集群搭建

本文搭建乙個三節點的kafka集群。該集群有三個zookeeper 三個kafka broker。解壓kafka安裝包,獲得如下目錄 unzip kafka 2.11 0.11.0.1.zip kafka 2.11 0.11.0.1 kafka目錄結構 cd kafka 2.11 0.11.0.1 ...

kafka2 3集群搭建

環境 3臺centos7.4 3臺zookeeper3.4.14 wget 解壓 tar zxvf kafka 2.11 2.3.0.tgz 進入kafka目錄,修改config server.properties,找到zookeeper.connect,修改zk集群的連線位址為 zookeeper...

kafka2 5 1集群部署

名稱 版本gcw1 kafka2.5.1 gcw2 kafka2.5.1 gcw3 kafka2.5.1 華為映象 解壓 創件軟連線vi etc profile新增 export path kafka home bin path 使配置檔案生效 source etc profile root gcw...