1. Zookeeper installation
Test JDK 1.1
1.2 Upload Package
zookeeper's official website: https: //zookeeper.apache.org/releases.html
1.3-extracting archive
tar -xvf zookeeper-3.4.14.tar.gz
1.4 delete archive, extract the files renamed zookeeper (custom)
1.5 Creating data and log files
1.6 zoo.cfg modify configuration files
1.6.1 into the data file pwd
, copy its path
1.6.2 Changing zoo_sample.cfg file named zoo.cfg
1.6.3 modify dataDir path, which is just a data path (dataLogDir similar)
1.7 is installed successfully detect Zooleeper
1.7.1 file into the bin directory, through sh zkServer.sh start
open
1.7.2 opening, through sh zkServer.sh status
detection state,
Status is displayed as standalone Description On success, your success install Zookeeper! ! !
2.Zookeeper Cluster Setup
2.1 Preparations
2.1.1 Creating zkCluster file again zookeeper's root directory, which then create zk1 / zk2 / zk3 three folders
2.1.2 Creating data and log files in three folders - mkdir {zk1,zk2,zk3} shentuylzc.cn {data,log}
2.2 Creating myid
2.2.1 Different document have different myid
myid -----www.yixingylzc.cn zk1 content of 1, zk2 is 2, zk3 3
2.3 edit the configuration file
2.3.1 copy the path of zk1
2.3.2 After modifying the configuration file is copied to zoo_www.shentuylgw.cn sample.cfg zoo1.cfg in the conf directory.
2.3.3 vim zoo1.cfg - >> change the configuration
- DataLogDir dataDir path and data path and to use the corresponding log
- The last digit of 2181 clientPort corresponding, simply follow myid numbers in the configuration, without modifying the remaining three
- server.1 / 2/3 is superimposed on a part of the way, easy to remember
- zoo2.cfg / zoo3.cfg just as I described above can change
- Remember server.1 / 2/3 does not need to change the configuration only once
2.4 Test Cluster Setup successful
sh zkServer.sh start www.lexuancaizc.cn zoo1.cfg 开启
sh zkServer.sh stop www.baishiyl2zc.cn zoo1.cfg 关闭
sh zkServer.sh status www.motianydl.cn zoo1.cfg 检测状态