当前位置:网站首页>Level 3: node status check, data view and update
Level 3: node status check, data view and update
2022-04-22 08:36:00 【True question OK】
The first 3 Turn off : Node status check 、 Data viewing and updating
100
- Mission requirements
- Refer to the answer
- Comment on 15
Task description
Our mission : Master node status check , Node value view , And node data update .
Related knowledge
In order to complete this mission , You need to master :1. Command line basic operations .
Node status check
First , Need to start the server , And use zkCli.sh Connect to server , Enter the client command line interface ( As mentioned in the first level ).
The node status contains the following information :
czxid: Timestamp of node creation .mzxid: The time when the node was last updated .ctime: Timestamp of node creation .mtime: The time when the node was last updated .pZxid: The timestamp of the last creation or deletion of the node or its child nodes .dataVersion: Update times of node data .cversion: The number of updates of its child nodes .aclVersion: nodeACL( Authorization information ) Number of updates .ephemeralOwner: If the node isephemeralnode ,ephemeralOwnerThe value represents thesession id; If the node is notephemeralnode ,ephemeralOwnerThe value is0.dataLength: Number of bytes of node data .numChildren: Number of child nodes .
for example , get /zoo1 Node information of , Use the following command ( As shown in the figure ):
stat /zoo1

Node value view
Get current node value , Use get command , When you get the data , The corresponding node status information will be listed .
for example , obtain /zoo1 The node data of This is a zoo1!, Use the following command ( As shown in the figure ):
get /zoo1

Node data update
When created, the node data is not suitable for the current requirements , You need to update the current node data . Update node data using set command , When updating data , The updated node status information will be listed .
for example , take /zoo1 The node data of This is a zoo1! Updated to This is my zoo1!!!, Use the following command ( As shown in the figure ):
set /zoo1 "This is my zoo1!!!"

Programming requirements
This task is to use the command line , Do the following :
-
Turn on ZooKeeper The server .
-
Using client (
zkCli.sh) Connect to server (IP:127.0.0.1, Port number :2181). -
establish
/myZNode, The node data isThis is my node!Persistent node of . -
see
/myZNodeNode status . -
take
/myZNodeThe node data is updated toThis is my second node!. -
Look again
/myZNodeNode status , Compare the similarities and differences with the previous node state . -
Disconnect the customer service terminal from the server .
Test instructions
The test of this level needs to be completed by the user under the command line on the right , The user only needs to directly operate the commands to be completed under the command line on the right , Then click the evaluation button , The platform will automatically verify whether the user checks the results as required .
Start your mission , wish you success !
I'll submit and upload the pure silly dog topic. Don't care
版权声明
本文为[True question OK]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220743122146.html
边栏推荐
- [跟着官方文档学JUnit5][二][WritingTests][学习笔记]
- 链表打印(链表反转输出)
- Flutter Foundation
- 又来一个上三角数字三角形
- 客户端与服务器通信项目4
- shell脚本学习笔记——正则表达式
- liunx基础—zabbix5.0监控系统安装部署
- Flutter Modul类与Json相互转换
- The starting point of the final end of the 15th day of the sprint to the big factory
- [no very low code] low code platform development diary, SQL programming of low code platform
猜你喜欢
随机推荐
shell笔记
617. 合并二叉树(Easy)
ospf四类,五类和七类LSA详解
Winsock编程接口实验:实现ping
SQL database multiple choice question (1)
Cesium加载地形数据(cesiumlab制作地形数据),从源数据到地形服务
cesium鼠标拾取要素,并判断要素类别
QT designer, jump, layout, style
Shell 命令脚本
第1关:节点监听机制
shell脚本学习笔记——shell对文件的操作sed
redis 简单使用
235. 二叉搜索树的最近公共祖先(Easy)
shell学习笔记——shell对输出流的处理awk
shell脚本学习笔记—循环语句
构造函数与toString
kubernetes学习笔记
第1关:继承
Level 2: polymorphism
100. 相同的树(Easy)








