Zookeeper cluster building tutorial, zookeeper cluster building

Source: Internet
Author: User
Tags zookeeper client

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.