1. Upload zookeeper-3.4.6.tar.gz installation package
2. Unzip Tar-xzf zookeeper-3.4.6.tar.gz
3. Configuration (first configured on a single node)
3.1 Adding a zoo.cfg configuration file
$ZOOKEEPER/conf
MV Zoo_sample.cfg Zoo.cfg
3.2 Modifying a configuration file (zoo.cfg)
Datadir=/itcast/zookeeper-3.4.5/data
server.1=ip:2888:3888
server.2=ip:2888:3888
server.3=ip:2888:3888
3.3 Create a myID file in (datadir=/itcast/zookeeper-3.4.5/data) with the contents of server. N in N (the content of SERVER.2 is 2)
echo "1" > myID
3.4 Copy the configured ZK to the other nodes
Scp-r/itcast/zookeeper-3.4.5/ip:/itcast/
Scp-r/itcast/zookeeper-3.4.5/ip:/itcast/
3.5 Note: Be sure to modify the contents of myID on other nodes
In itcast06 should talk about myID content changed to 2 (echo "6" > myID)
In itcast07 should talk about myID content changed to 3 (echo "7" > myID)
4. Start the cluster
Start ZK separately
./zkserver.sh Start
Linux Installation Zookeeper