一、环境介绍

 主机:三台,Centos7.6+docker19.03.4 (192.168.145.7,192.168.145.67,192.168.145.77)

 镜像:zookeeper:latest(docker pull zookeeper)version 3.6.1,wurstmeister/kafka:latest (docker pull wurstmeister/kafka) version 2.13_2.6.0,kafka-manager(docker pull sheepkiller/kafka-manager)version 1.3.1.8

二、Docker安装

 Docker安装:https://www.cnblogs.com/hovin/p/13630569.html

三、zookeeper集群搭建

(1) 下载镜像,三台都一样

[root@localhost ~]# docker pull zookeeper

(2) 创建本地目录,三台都一样

[root@localhost ~]# mkdir -pv /kafka_cluster/zookeeper/{conf,data,datalog}

(3) 准备配置文件,zoo.cfg 和 log4j.properties,三台都一样

[root@localhost ~]# vim /kafka_cluster/zookeeper/conf/zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
# zookeeper镜像中设定会将zookeeper的data与dataLog分别映射到/data, /datalog
# 本质上,这个配置文件是为zookeeper的容器所用,容器中路径的配置与容器所在的宿主机上的路径是有区别的,要区分清楚。
dataDir=/data
dataLogDir=/datalog
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1t
server.1=192.168.145.7:2888:3888
server.2=192.168.145.67:2888:3888
server.3=192.168.145.77:2888:3888
zoo.cfg

相关文章:

  • 2019-10-19
  • 2021-11-02
  • 2021-10-10
  • 2022-12-23
  • 2021-06-28
  • 2021-12-10
猜你喜欢
  • 2021-11-28
  • 2021-12-05
  • 2022-12-23
  • 2021-11-23
  • 2021-06-06
  • 2021-11-18
  • 2021-11-18
相关资源
相似解决方案