Zookeeper + kafka + kafka-eagle to build a cluster experiment

lab environment:

CPU name IP addresses install software operating system
kafka-01 192.168.3.1 zookeeper-3.4.12 | kafka_2.11-2.4.0 | jdk-8u171-linux-x64 | kafka-eagle-bin-1.2.4 Centos7.3
kafka-02 192.168.3.2 zookeeper-3.4.12 | kafka_2.11-2.4.0 | jdk-8u171-linux-x64 Centos7.3
kafka-03 192.168.3.3 zookeeper-3.4.12 | kafka_2.11-2.4.0 | jdk-8u171-linux-x64 Centos7.3

Package Address: https://pan.baidu.com/s/1y4Kp_LRKtA68vOqdhfA9vA

Prerequisites environment:

# Installation jdk, modify the host name, modify the hosts file

cat /etc/hosts

Kafka-01 192.168.3.2
192.168.3.3 Kafka-02
192.168.3.4 Kafka-03

tar -zxvf jdk-8u171-linux-x64.tar.gz

mv jdk1.8.0_171 /usr/local/java

vim /etc/profile

JAVA_HOME=/usr/local/java
JRE_HOME=$JAVA_HOME/jre
CLASS_PATH=.:/lib/dt.jar:/lib/tools.jar:/lib
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

 source /etc/profile

Zookeeper cluster deployment 

tar -zxvf zookeeper-3.4.10.tar.gz

mv zookeeper-3.4.10 /usr/local/zookeeper

cd /usr/local/zookeeper/conf/

mv zoo_sample.cfg zoo.cfg

I came zoo.cfg

dataDir=/usr/local/zookeeper/data
server.1=master:2888:3888
server.2=slave1:2888:3888
server.3=slave2:2888:3888 

cd /usr/local/zookeeper/

mkdir data && cd data

echo "1"> myid # attention back here once for several machines 2, 3 .......

cd /usr/local/zookeeper/bin

./zkServer.sh start

./zkServer.sh status

Kafka cluster deployment

t -zxvf kafka_2.11-2.4.0.tgz

mv kafka_2.11-2.4.0 /usr/local/kafka

cd /usr/local/kafka

vim config/server.properties

# master为0
broker.id=0                                    #修改
advertised.host.name=kafka-01     #修改
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/tmp/kafka-logs
num.partitions=40
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=24
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
# 连接
zookeeper.connect=kafka-01:2181,kafka-02:2181,kafka-03:2181  #修改
zookeeper.connection.timeout.ms=6000
group.initial.rebalance.delay.ms=0
# 可删除topic
delete.topic.enable=true

bin/kafka-server-start.sh config/server.properties &

Kafka-eagle deployment of WEB interface

tar -zxvf kafka-eagle-bin-1.2.4.tar.gz

cd kafka-eagle-bin-1.2.4/

tar -zxvf kafka-eagle-web-1.2.4-bin.tar.gz

mv kafka-eagle-web-1.2.4 /usr/local/kafka-eagle

vim /usr/local/kafka-eagle/conf/system-config.properties

######################################
# multi zookeeper&kafka cluster list
######################################
kafka.eagle.zk.cluster.alias=cluster1
cluster1.zk.list=master:2181,slave1:2181,slave2:2181    #改

######################################
# zk client thread limit
######################################
kafka.zk.limit.size=25

######################################
# kafka eagle webui port
######################################
kafka.eagle.webui.port=8048

######################################
# kafka offset storage
######################################
cluster1.kafka.eagle.offset.storage=kafka

######################################
# enable kafka metrics
######################################
kafka.eagle.metrics.charts=false

######################################
# alarm email configure
######################################
kafka.eagle.mail.enable=true
kafka.eagle.mail.sa=alert_sa
[email protected]
kafka.eagle.mail.password=mqslimczkdqabbbh
kafka.eagle.mail.server.host=smtp.163.com
kafka.eagle.mail.server.port=25

######################################
# delete kafka topic token
######################################
kafka.eagle.topic.token=keadmin

######################################
# kafka sasl authenticate
######################################
kafka.eagle.sasl.enable=false
kafka.eagle.sasl.protocol=SASL_PLAINTEXT
kafka.eagle.sasl.mechanism=PLAIN

######################################
# kafka jdbc driver address
######################################
kafka.eagle.driver=org.sqlite.JDBC
kafka.eagle.url=jdbc:sqlite:/usr/local/kafka-eagle/db/ke.db           #改
kafka.eagle.username=root 
kafka.eagle.password=testadad

cd /usr/local/kafka-eagle/bin/

chmod +x *

./ke.sh start 

Show results: 

Published 65 original articles · won praise 16 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_41674452/article/details/104062329