Zookeeper cluster building tutorial, zookeeper cluster building
1. There are three nodes in total (the zk server cluster is no less than three nodes), and the system time between servers must be consistent.
2 unzip tarzookeeper-3.4.5.tar.gz
3 rename mvzookeeper-3.4.5 zookeeper
4. Modify the environment variable vi/etc/profile.
Export zookeeper_home =/usr/local/zookeeper
Exportpath =.; $ zookeeper_home/bin; $ JAVA_HOME /...
5. Refresh Source/etc/profile
6. modify the configuration file under zookeeper
Cd/usr/local/zookeeper/conf
Mvzoo_sample.cfg zoo. cfg
7. Modify conf vi zoo. cfg
1 dataDir =/usr/local/zookeeper/data
2. Create a myid file under the configured dataDir file and write 0 to the myid file (server.0 writes 0, server.1 writes 1, and server.2 writes 2)
3. Add
Server.0 = ip: 2888: 3888
Server.1 = ip: 2888: 3888
Server.2 = ip: 2888: 3888
8. Create the folder data in the/usr/local/zookeeper/directory.
9 start zookeeper:
ZkServer. sh start in the bin directory
View status zkServer. sh status
After zkCli. sh enters the zookeeper client
Search for ls/zookeeper
Create and assign values to create/key value
Get/key
Set/key value
We can see the data consistency of the zookeeper cluster.
Rmr/path recursively Delete nodes
Delete/path/child Delete a specified Node