前言
Reprinted from: https://blog.51cto.com/metebee/1730280
步骤
-
download
Zookeeper-3.4.12.rar
-
Modify the zoo.cfg file under conf
-
Edit zoo.cfg information
ps:此处仅是删除掉了注释,添加了下面的server.1,server.2,server.3。至于其含义,搭建成功后,自己可以另外查询
Key 1: The path of data and log, if it is a left slash, you need to add two. Otherwise, it will crash during startup.
Key 2: When copying the second zookeeper, don't forget to modify the zookeeper path of dataDir and dataLogDir and the port number of clientPorttickTime=2000 initLimit=10 syncLimit=5 dataDir=D:\\Program Files\\ZookeeperCluster\\Zookeeper-3.4.12-1\\data dataLogDir=D:\\Program Files\\ZookeeperCluster\\Zookeeper-3.4.12-1\\log clientPort=2181 server.1=127.0.0.1:2881:3881 server.2=127.0.0.1:2882:3882 server.3=127.0.0.1:2883:3883
-
Create a file in the data folder
myid
. The content is the serial number of the current server.
The clientPort port of Bill's current configuration file is 2181, which corresponds to server.1, so the content of myid is 1. Adding later will be processed once. -
result
-
It is normal to report an error when starting up. After all three are started, there is no problem. At this time, you can use some tools to link.