zookeeper kafka集群

kafka集群依赖zookeeper运行,新版本不依赖zookeeper,但不具备生产环境使用条件

zookeeper集群部署

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
https://zookeeper.apache.org/releases.html

https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz


edit conf/zoo.cfg
tickTime=2000
dataDir=/var/lib/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888

./bin/zkServer.sh start conf/zoo.cfg

kafka集群部署

1
2
3
4
5
6
7
8
9
10
https://kafka.apache.org/documentation

https://www.apache.org/dyn/closer.cgi?path=/kafka/2.8.0/kafka_2.13-2.8.0.tgz

tar -xf kafka_2.13-2.8.0.tgz
cd kafka_2.13-2.8.0
cat config/server.properties
broker.id=0 # 每节点不同
zookeeper.connect=10.17.100.10:2181,10.17.100.20:2181,10.17.100.30:2181 # 相同配置
./bin/kafka-server-start.sh config/server.properties

总结

先写下