In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the Linux system how to start zookeeper, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The ZooKeeper command line tool is similar to Linux's shell environment, but certainly not as functional as shell.
Zookeeper installation directory: / usr/local/zookeeper-3.4.6/bin/zkServer.sh
Configuration file path:.. / conf/zoo.cfg
Port: 2181
ZooKeeper service command: after the corresponding configuration is ready, you can perform service-related operations directly through the zkServer.sh script.
\ 1. Start the ZK service: sh bin/zkServer.sh start
\ 2. View ZK service status: sh bin/zkServer.sh status
\ 3. Stop the ZK service: sh bin/zkServer.sh stop
\ 4. Restart the ZK service: sh bin/zkServer.sh restart
Zk client command ZooKeeper command line tool is similar to Linux's shell environment, but its function is certainly not as good as shell, but with it we can easily access ZooKeeper, create data, modify data and so on. Connect to the ZooKeeper service using zkCli.sh-server 127.0.0.1 ZooKeeper 2181. After the connection is successful, the system will output the relevant environment and configuration information of the ZooKeeper.
Some simple actions of the command line tool are as follows:
\ 1. Show root directory, file: ls / use the ls command to see what is contained in the current ZooKeeper
\ 2. Display the root directory, file: ls2 / view the current node data and see the number of updates and other data
\ 3. Create the file and set the initial content: create / zk "test" create a new znode node "zk" and the string associated with it
\ 4. Get the contents of the file: get / zk confirms whether the znode contains the string we created
\ 5. Modify the contents of the file: set / zk "zkbak" sets the string associated with zk
\ 6. Delete file: delete / zk delete the znode you just created
\ 7. Exit client: quit
\ 8. Help command: help
ZooKeeper commonly used four-word commands: ZooKeeper supports the interaction of certain four-character command letters with them. Most of them are query commands that are used to obtain the current status and related information of the ZooKeeper service. Users can submit corresponding commands to ZooKeeper through telnet or nc on the client side.
\ 1. You can see which node is selected as follower or leader by command: echo stat | nc 127.0.0.1 2181
\ 2. Use echo ruok | nc 127.0.0.1 2181 to test whether the Server is started. If you reply to imok, it indicates that it has been started.
\ 3. Echo dump | nc 127.0.0.1 2181, listing unprocessed sessions and temporary nodes.
\ 4. Echo kill | nc 127.0.0.1 2181, disable server
\ 5. Echo conf | nc 127.0.0.1 2181, which outputs the details of the service configuration.
\ 6. Echo cons | nc 127.0.0.1 2181, listing the full connection / session details of all clients connected to the server.
\ 7. Echo envi | nc 127.0.0.1 2181, which outputs details about the service environment (different from the conf command).
\ 8. Echo reqs | nc 127.0.0.1 2181, listing unprocessed requests.
\ 9. Echo wchs | nc 127.0.0.1 2181, listing the details of the server watch.
\ 10. Echo wchc | nc 127.0.0.1 2181, which lists the details of the server watch through session, and its output is a list of watch-related sessions.
\ 11. Echo wchp | nc 127.0.0.1 2181, which lists the details of the server watch by path. It outputs a path related to session.
Thank you for reading this article carefully. I hope the article "how to start zookeeper in Linux system" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.