Install zookeeper in Linux and zookeeper in linux
1. Upload the zookeeper-3.4.6.tar.gz installation package
2. Unzip tar-xzf zookeeper-3.4.6.tar.gz
3. Configure (first on a node)
3.1 Add a zoo. cfg configuration file
$ ZOOKEEPER/conf
Mv zoo_sample.cfg zoo. cfg
3.2 modify the 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 content of N in server. N (2 in server.2)
Echo "1"> myid
3.4 copy the configured zk to another node.
Scp-r/itcast/zookeeper-3.4.5/IP:/itcast/
Scp-r/itcast/zookeeper-3.4.5/IP:/itcast/
3.5 Note: You must modify the content of myid on other nodes.
In itcast06, the content of myid should be changed to 2 (echo "6"> myid)
In itcast07, change the content of myid to 3 (echo "7"> myid)
4. Start the Cluster
Start zk separately
./ZkServer. sh start