For cluster installation overview, see here
Zookeeper Configuration
1. Add ZK path settings to/etc/profile. See the background description above.
2. Go ~ /ZK/conf directory, copy zoo_sample.cfg to zoo. cfg
Vim zoo. conf
Ticktime = 2000 initlimit = 10 synclimit = 5 datadir =/home/hadoop/HDFS/ZK/datadatalogdir =/home/hadoop/HDFS/ZK/logclientport = 2181server. 21 = zk1: 2888: 3888server. 22 = ZK2: 2888: 3888server. 23 = zk3: 2888: 3888
Make sure to create ~ /HDFS/ZK/data and log directories. In the data directory, You need to manually create a myid file with numbers corresponding to X in server. X.
Start zookeeper and run the following command on each ZK node:
Zkserver. Sh start
View the zookeeper status and use
Zkserver. Sh status
If any problem occurs, you can start zookeeper the day before yesterday and find the problem by searching the console output:
Zkserver. Sh start-foreground