First step: Unzip the zookeeper-3.4.5.tar.gz to the D:\solrCloud directory and rename it to zookeeper-1.
Step Two: Change the zoo_sample.cfg in the D:\solrCloud\ zookeeper-1\conf\ directory to zoo.cfg . and write the following configuration parameters:
ticktime=2000
initlimit=10
Synclimit=5
Datadir=d:/solrcloud/zookeeper-1/data
Datalogdir=d:/solrcloud/zookeeper-1/datalog
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
and create the corresponding data and datalog directories according to the configuration . If you do not create a directory, it does not start correctly.
Create a file in the data directory myID ( no suffix required ), write a number in the myid file 1 and save the exit.
step three: Putzookeeper-1Copy 2 copies , respectively named zookeeper-2,zookeeper-3. Then modify eachzookeeper-*the conf directory under the zoo.cfg datadir and datalogdir and clientport. Modify the scenario as follows:
|
DataDir |
Datalogdir |
ClientPort |
Zookeeper-1 |
d:/solrcloud/ Zookeeper-1/data |
D:/solrcloud/zookeeper-1/datalog |
2181 |
Zookeeper-2 |
D:/solrcloud/zookeeper-2/data |
D://solrcloud/zookeeper-2/datalog |
2182 |
Zookeeper-3 |
d:/solrcloud/ Zookeeper-3/data |
D:/solrcloud/zookeeper-3/datalog |
2183 |
and modify the contents of the myID file in each data directory . zookeeper-1is 1, zookeeper-2is 2, zookeeper-3is 3 .
Fourth Step: Start three Zookeeper . and verify that the configuration is successful. directory structure and startup directory such as :
Note: When connecting the first, there is exception information, no tube, and so on are connected together there is no exception.
Enter the cmd command, enter : netstat-ano|findstr 2181 to see if the port is enabled
This article is from the "codingorthinking" blog, make sure to keep this source http://metebee.blog.51cto.com/8650444/1730280
Zookeeper cluster setup (Windows)