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