The number of management zookeeper 'animals'', such as small as Hadoop, whale hbase the like, to install a fully distributed zookeeper the recording, for later use.
Extracting archive zookeeper
[root@hadoop01 /home/software]# tar -zxvf zookeeper-3.4.8.tar.gz
Modify zoo.cfg
Zoo_sample.cfg first sample copy is zoo.cfg, will be modified is zoo.cfg.
[root@hadoop01 /home/software/zookeeper-3.4.8/conf]# cp zoo_sample.cfg zoo.cfg
Modify zoo.cfg.
# Add Configuration tmp directory, which will be configured myid dataDir = / Home / Software / zookeeper- 3.4 . 8 / tmp ... omitted # Configure three of ip, port and electoral broadcast port Server. 1 = 192.168 . 200.140 : 2888 : 3888 Server. 2 = 192.168 . 200.150 : 2888 : 3888 . Server . 3 = 192.168 . 200.160 : 2888 : 3888
Edit myid
Tmp directory needs to be created in the root directory zookeeper manually edit the digital myid the above server, three nodes 1,2,3, respectively.
# Hadoop01 node configuration 1, and so other [@ hadoop01 the root / Home / Software / zookeeper- 3.4 . . 8 / tmp] # CAT MyID 1 by You have have new new mail in / var / spool / mail / the root
Remote Copy
Zookeeper on the remote copy to the node hadoop01 hadoop02 and hadoop03, two nodes remember myid modified.
# Remote copy to hadoop02, if it is software directory, use the following command directly, you can use absolute paths [root @ hadoop01 / Home / software] # scp -r zookeeper- 3.4 . 8 root hadoop02 @: $ PWD # remote copy to hadoop03 [root @ hadoop01 / Home / Software] # scp -r zookeeper- 3.4 . 8 root @ hadoop03: $ PWD
start up
Zookeeper enter the root directory, boot into the bin zookeeper three nodes, and view the status of three zookeeper, if 1 2 from the master, then the installation is successful.
Three start
[root@hadoop01 /home/software/zookeeper-3.4.8/bin]# ./zkServer.sh start
Check status, if started in the hadoop1, hadoop2 and hadoop3 order, a first follower, Leader is a second, a third is follower. This uses more than half of the election rules ZAB subsequent supplements.
# 第二台是leader [root@hadoop02 /home/software/zookeeper-3.4.8/bin]# ./zkServer.sh status ZooKeeper JMX enabled by default Using config: /home/software/zookeeper-3.4.8/bin/../conf/zoo.cfg Mode: leader
This completes the installation zookeeper fully distributed deployment.