主机:三台,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
[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