Zookeeper client zkcli.sh using the View node

Source: Internet
Author: User
Tags redis zookeeper zookeeper client root directory

Login Zookeeper Client

[root@nysjhl99-54 zookeeper]# cd/usr/local/zookeeper/bin
[root@nysjhl99-54 bin]#./zkcli.sh-server 127.0.0.1:2181

[zk:127.0.0.1:2181 (CONNECTED) 0] LS/
[Dubbo, Search-card, Redis, zookeeper]

ZK Client Command

The Zookeeper command-line tool is similar to a Linux shell environment, but it is certainly less powerful than the shell, but with it we can simply access the zookeeper, create data, modify data, and so on. Using Zkcli.sh-server 127.0.0.1:2181 to connect to the ZooKeeper service, the system outputs the relevant environment and configuration information for ZooKeeper when the connection is successful.

Some simple operations of the command-line tool are as follows: 1. Display the root directory, file: LS/use the LS command to see what is contained in the current ZooKeeper 2. Display root directory, file: LS2/view current node data and can see the number of updates and other data 3. Create the file and set the initial content: Create/zk "Test" creates a new Znode node "ZK" and the string 4 associated with it. Get file Contents: Get/zk Confirm that the Znode contains the string we created 5. Modify file content: Set/zk "Zkbak" sets the string associated with ZK to 6. Delete file: Delete/zk Delete the znode that you just created 7. Quit client: Quit 8. Help commands:




The project is actually available with zookeeper below to establish some znode, Znode maps to Redis instances on other servers. So as to achieve the governance of Redis


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.