当前位置:网站首页>Level 3: node quota and other commands
Level 3: node quota and other commands
2022-04-22 08:36:00 【True question OK】
The first 3 Turn off : Node quota and other commands
200
- Mission requirements
- Refer to the answer
- Comment on 20
Task description
Our mission : Have a good command of ZooKeeper Quota for (quota ) Setting method and other commands of node .
Related knowledge
In order to complete this mission , You need to master :1.ZooKeeper Server startup and client startup ,2. Command line basic operations ,3.ZooKeeper Node quota method and basic operation .
quota( The quota )
ZooKeeper The quota mechanism is used to manage the data size of the current node and the number of child nodes . You can set quota limits on nodes , If the configuration limit is exceeded ,ZooKeeper Will be in log Print in log WARN journal , But it doesn't stop the behavior operation .
ZooKeeper The quota is stored in /zookeeper/quota The next path . Can pass ZooKeeper client APIs perhaps ZooKeeper Java Shell To carry out set,list,delete The quota . With /zoo1 Node as an example , explain 3 How to use commands .
-
First, list the quota of the current node , Use the following command :
listquota /zoo1

You can find ,
zoo1The node has no quota set . Set node quota usagesetquotacommand . for example , Set the quota of this node to3, Use the following command :setquota -n 3 /zoo1

-nIndicates setting the node number limit , It means/zoo1The number of nodes under the path is limited to3( Include this node );-bIndicates setting the byte size limit of node data .Use
listquotaCommand to view the current node quota , Same as setting quota value .
ZooKeeper Use a more gentle way , If the configuration limit is exceeded ,ZooKeeper Will be in
logPrint in logWARNjournal , It does not stop the behavior operation . for example , establish/zoo1Of3Child node , Use the following command :create /zoo1/child1 ""create /zoo1/child2 ""create /zoo1/child3 ""

When a node is created , From the log ( Or server front end ) Get the information shown in the figure below :

-
Delete node quota usage
delquotacommand . for example , Delete/zoo1The number of nodes is limited , Use the following command :delquota /zoo1

Other commands
-
ls2: List the details of the current node .
-
sync: When reading a node , It should be done firstsyncMethod , Make the connection of the read operation connected ZooKeeper Examples can be compared withleaderTo synchronize , So that you can read the latest content .
-
history: Before listing10Historical orders .
-
redo: Reexecution ofNOrders .
Programming requirements
This task is to use the command line , Do the following :
-
Turn on ZooKeeper The server .
-
Using client (
zkCli.sh) Connect to the client (IP:127.0.0.1, Port number :2181). -
establish
/test_quotaPersistent node ( Node data is empty ). -
Set up
/test_quotaThe number of path nodes is limited to3. -
Disconnect the client (
zkCli.sh) Connect with customer service terminal .
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 !
版权声明
本文为[True question OK]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220743122013.html
边栏推荐
猜你喜欢

redis 简单使用

手把手教你实现RecyclerView的下拉刷新和上拉加载更多

Viewpager comprehensive summary

236. 二叉树的最近公共祖先(Medium)

Under the new retail development trend, how to operate and promote the social e-commerce platform?

第1关:节点监听机制

ViewPager用法详细解析

Simple use of fresco - simpledraweeview

OLED显示驱动

The domestic cloud security market has exceeded 10 billion yuan. What is the future development trend?
随机推荐
累加器
链表打印(链表反转输出)
Flutter Foundation
图片旋转
[跟着官方文档学JUnit5][二][WritingTests][学习笔记]
第1关:创建/删除节点
Fresco简单的使用—SimpleDraweeView
Handler related source code analysis
VirtualBox虚拟机(甲骨文Oracle VM )
101. 对称二叉树(Easy)
[Dahua cloud native] micro service chapter - service mode of five-star hotels
Common sense and use of Oracle Database
用OnLayoutChangeListener的方法解决getTop=0的问题
226. 翻转二叉树(Easy)
【论文阅读】【3d目标检测】pvgnet
235. 二叉搜索树的最近公共祖先(Easy)
Installation de MySQL par CentOS
Binary leading zero
字符串的替换
SQL数据库选择题(2)









