In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "introduction to the specific usage of ZooKeeper". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Once ZooKeeper is installed, you can use telnet to test whether it is running or not.
Telnet 127.0.0.1 2100Trying 127.0.0.1...Connected to 127.0.0.1.Escape character is'^] '.statZookeeper version: 3.4.6-1569965, built on 02 Unip 2014 09:09 GMTClients: / 127.0.0.1 GMTClients 34656 [0] (queued=0,recved=1,sent=0) / 127.0.0.1 GMTClients 34531 [1] (queued=0,recved=57,sent=57) Latency min/avg/max: 0/2/73Received: 59Sent: 58Connections: 2Outstanding: 0Zxid: 0x3Mode: standaloneNode count: 5
Stand-alone standalone mode is used here.
You can also use the client script to connect to the server
Bash zkCli.sh-server 127.0.0.1purl 2100
Once connected, you can use ZooKeeper as if you were using a NOSQL (memcached,redis) database.
Set-get value
First create a ZooKeeper node using the create command
Create / titus 18189597900
The ls / command can see which nodes there are.
[zk: 127.0.0.1 zk-book 2100 (CONNECTED) 3] ls / [zk-book, zookeeper, titus]
The get path command can view the data of a specified node
[zk: 127.0.0.1 get 2100 (CONNECTED) 4] get / titus18189597900cZxid = 0x6ctime = Mon Oct 12 21:44:14 CST 2015mZxid = 0x6mtime = Mon Oct 12 21:44:14 CST 2015pZxid = 0x6cversion = 0dataVersion = 0aclVersion = 0ephemeralOwner = 0x0dataLength = 11numChildren = 0
The first line is the data of the titus node 18189597900.
The set path data command can change the data of a specified node
[zk: 127.0.0.1 CONNECTED] set / titus 1571111cZxid = 0x6ctime = Mon Oct 12 21:44:14 CST 2015mZxid = 0x7mtime = Mon Oct 12 21:47:06 CST 2015pZxid = 0x6cversion = 0dataVersion = 1aclVersion = 0ephemeralOwner = 0x0dataLength = 7numChildren = 0
The version of dataVersion has changed from 0 to 1.
This is the end of the introduction to the specific usage of ZooKeeper. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.