forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
36 lines
12 KiB
HTML
36 lines
12 KiB
HTML
<a name="mrs_01_2104"></a><a name="mrs_01_2104"></a>
|
|
|
|
<h1 class="topictitle1">Configuring a Quota for a Znode</h1>
|
|
<div id="body8662426"><div class="section" id="mrs_01_2104__en-us_topic_0000001219231125_s1a509f7c6842413ca5973ea9f0ecf612"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_2104__en-us_topic_0000001219231125_p1155191012181">Set a quota for Znodes in ZooKeeper of a security cluster in O&M scenarios or service scenarios to restrict the quantity and byte space of Znodes and subnodes.</p>
|
|
<p id="mrs_01_2104__en-us_topic_0000001219231125_p15539152001818">Two modes are available:</p>
|
|
<ul id="mrs_01_2104__en-us_topic_0000001219231125_ul54942256190"><li id="mrs_01_2104__en-us_topic_0000001219231125_li114941725171920">On Manager, enable the automatic quota setting function and set related configuration items to enable the ZooKeeper service to automatically set the Znode quota. For details, see <a href="#mrs_01_2104__en-us_topic_0000001219231125_li39081429191111">1</a> to <a href="#mrs_01_2104__en-us_topic_0000001219231125_li1991010290113">8</a>.</li><li id="mrs_01_2104__en-us_topic_0000001219231125_li1024683381917">On Manager, disable the automatic quota setting function and run commands on the client to manually set the Znode quota. For details, see <a href="#mrs_01_2104__en-us_topic_0000001219231125_li39081429191111">1</a> to <a href="#mrs_01_2104__en-us_topic_0000001219231125_li1190922991115">3</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="mrs_01_2104__en-us_topic_0000001219231125_sbed1ec0e7ebc4fe1b4d0c6cc8351de49"><h4 class="sectiontitle">Impact on the System</h4><p id="mrs_01_2104__en-us_topic_0000001219231125_a031951f49dc945c8a1e8b49ede4828c2">If the configured quantity or capacity quota is less than the quantity or capacity of directories required for normal service running, services may fail to run properly. Exercise cautions when setting the quota.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_2104__en-us_topic_0000001219231125_s623aa783d8ce4bbbba95c82e3d0c58e2"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_2104__en-us_topic_0000001219231125_a92b18b78450149469616f9bd404ba812">The ZooKeeper client has been installed in a directory, for example, <strong id="mrs_01_2104__en-us_topic_0000001219231125_b99368211342130">/opt/client</strong>.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_2104__en-us_topic_0000001219231125_s997fb4f812fb4db6b11f4f20a56b11c8"><h4 class="sectiontitle">Procedure</h4><p id="mrs_01_2104__en-us_topic_0000001219231125_p246817561879"><strong id="mrs_01_2104__en-us_topic_0000001219231125_b234383422019">Use the automatic quota setting function.</strong></p>
|
|
<ol id="mrs_01_2104__en-us_topic_0000001219231125_ol1891018299111"><li id="mrs_01_2104__en-us_topic_0000001219231125_li39081429191111"><a name="mrs_01_2104__en-us_topic_0000001219231125_li39081429191111"></a><a name="en-us_topic_0000001219231125_li39081429191111"></a><span>Go to the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b4741194710518">All Configurations</strong> page of ZooKeeper. Click the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b1526613410526">Quota</strong> tab and set <strong id="mrs_01_2104__en-us_topic_0000001219231125_b1610113495217">quotas.auto.check.enable</strong> to <strong id="mrs_01_2104__en-us_topic_0000001219231125_b7235237185214">true</strong>, and click <strong id="mrs_01_2104__en-us_topic_0000001219231125_b57484016521">Save</strong>. For details, see <a href="mrs_01_1293.html">Modifying Cluster Service Configuration Parameters</a>.</span></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li1790916295119"><span>Determine whether to set the quota of the top directory (for example, Yarn service) on ZooKeeper.</span><p><ul id="mrs_01_2104__en-us_topic_0000001219231125_ul1390992961118"><li id="mrs_01_2104__en-us_topic_0000001219231125_li2909829111110">If yes, go to <a href="#mrs_01_2104__en-us_topic_0000001219231125_li1190922991115">3</a>.</li><li id="mrs_01_2104__en-us_topic_0000001219231125_li59091029191119">If no, go to <a href="#mrs_01_2104__en-us_topic_0000001219231125_li149104295112">5</a>.</li></ul>
|
|
</p></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li1190922991115"><a name="mrs_01_2104__en-us_topic_0000001219231125_li1190922991115"></a><a name="en-us_topic_0000001219231125_li1190922991115"></a><span>Go to the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b7719181645511">All Configurations</strong> page of Yarn by referring to <a href="mrs_01_1293.html">Modifying Cluster Service Configuration Parameters</a> and search for <strong id="mrs_01_2104__en-us_topic_0000001219231125_b689194315517">zk.quota</strong>.</span></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li1990992918116"><span>Set the following quotas properly and click Save. The ZooKeeper service periodically sets the quota of the Yarn service on the top directory of ZooKeeper.</span><p><ol type="a" id="mrs_01_2104__en-us_topic_0000001219231125_ol690992916115"><li id="mrs_01_2104__en-us_topic_0000001219231125_li39099293111"><strong id="mrs_01_2104__en-us_topic_0000001219231125_b134814084042130">zk.quota.number</strong> indicates the directory quota of the service on ZooKeeper.</li><li id="mrs_01_2104__en-us_topic_0000001219231125_li8909929191115"><strong id="mrs_01_2104__en-us_topic_0000001219231125_b3399803342130">zk.quota.bytes</strong> indicates the capacity quota of the service directory on ZooKeeper.</li></ol>
|
|
<div class="note" id="mrs_01_2104__en-us_topic_0000001219231125_note17909112951120"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_2104__en-us_topic_0000001219231125_p89093291116">If the configured quantity or capacity quota is less than the actual quantity or capacity quota of the current directory, the setting can be saved successfully. However, an alarm indicating that the setting is invalid is displayed on the page, prompting you to reset the quota.</p>
|
|
<p id="mrs_01_2104__en-us_topic_0000001219231125_p390915299111">If the configured quantity or capacity quota is less than the quantity or capacity of directories required for normal service running, services may fail to run properly. Exercise cautions when setting the quota.</p>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li149104295112"><a name="mrs_01_2104__en-us_topic_0000001219231125_li149104295112"></a><a name="en-us_topic_0000001219231125_li149104295112"></a><span>Check whether quotas of other custom top directories except service directories need to be configured.</span><p><ul id="mrs_01_2104__en-us_topic_0000001219231125_ul291092914117"><li id="mrs_01_2104__en-us_topic_0000001219231125_li7910629121115">If yes, go to <a href="#mrs_01_2104__en-us_topic_0000001219231125_li5910829141117">6</a>.</li><li id="mrs_01_2104__en-us_topic_0000001219231125_li189101529151116">If no, no further action is required.</li></ul>
|
|
</p></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li5910829141117"><a name="mrs_01_2104__en-us_topic_0000001219231125_li5910829141117"></a><a name="en-us_topic_0000001219231125_li5910829141117"></a><span>Go to the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b83542055165520">All Configurations</strong> page of ZooKeeper and click the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b96271165616">Quota</strong> tab.</span></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li14910132961115"><span>Enter the top directory (for example, <strong id="mrs_01_2104__en-us_topic_0000001219231125_b6717323412">/abc</strong>) of ZooKeeper in the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b167643217419">Value</strong> text box of <strong id="mrs_01_2104__en-us_topic_0000001219231125_b1976143212411">customized.quota</strong>.</span></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li1991010290113"><a name="mrs_01_2104__en-us_topic_0000001219231125_li1991010290113"></a><a name="en-us_topic_0000001219231125_li1991010290113"></a><span>In the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b9847184053">Value</strong> text box, enter the quantity quota and capacity quota separated by a comma (,). (You can also set only the quantity quota). If you need to set quotas for multiple top directories, click <strong id="mrs_01_2104__en-us_topic_0000001219231125_b186166991342130">+</strong> to add quotas. Click <strong id="mrs_01_2104__en-us_topic_0000001219231125_b122545206242130">Save</strong>. The ZooKeeper service automatically sets the quota of the top directory periodically. No further action is required.</span><p><div class="note" id="mrs_01_2104__en-us_topic_0000001219231125_note3910142913110"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_2104__en-us_topic_0000001219231125_p791012299110">The entered quantity quota cannot be greater than the value of <strong id="mrs_01_2104__en-us_topic_0000001219231125_b68226121242130">max.znode.count</strong>. The entered capacity quota cannot be greater than the value of <strong id="mrs_01_2104__en-us_topic_0000001219231125_b116964097342130">max.data.size</strong>.</p>
|
|
<p id="mrs_01_2104__en-us_topic_0000001219231125_p13910192991115">If the top directory on ZooKeeper is not the top directory of a service, and its quota is not specified using <strong id="mrs_01_2104__en-us_topic_0000001219231125_b177938012242130">customized.quota</strong>, the ZooKeeper service sets the quota to the value of <strong id="mrs_01_2104__en-us_topic_0000001219231125_b115432581442130">defaultQuota</strong>.</p>
|
|
</div></div>
|
|
</p></li></ol>
|
|
<p id="mrs_01_2104__en-us_topic_0000001219231125_p168127565206"><strong id="mrs_01_2104__en-us_topic_0000001219231125_b15222321202316">Run commands on the client.</strong></p>
|
|
<ol start="9" id="mrs_01_2104__en-us_topic_0000001219231125_ol1990812916113"><li id="mrs_01_2104__en-us_topic_0000001219231125_li169071295112"><span>Go to the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b538214445619">All Configurations</strong> page of ZooKeeper. Click the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b5386114115612">Quota</strong> tab and set <strong id="mrs_01_2104__en-us_topic_0000001219231125_b33876412569">quotas.auto.check.enable</strong> to <strong id="mrs_01_2104__en-us_topic_0000001219231125_b153870419562">false</strong>, and click <strong id="mrs_01_2104__en-us_topic_0000001219231125_b1138713485612">Save</strong>.</span></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li16907152931119"><span>Start the ZooKeeper client. For details, see <a href="mrs_01_2095.html">Using a ZooKeeper Client</a>.</span><p><div class="note" id="mrs_01_2104__en-us_topic_0000001219231125_note7907112915118"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_2104__en-us_topic_0000001219231125_p69073294116">In security mode, user authentication is required to start the ZooKeeper client. The ZooKeeper user (system administrator of ZooKeeper) is used for authentication, and the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b6268151311507">kinit zookeeper</strong> command is executed.</p>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_2104__en-us_topic_0000001219231125_li390832951114"><span>Run the <strong id="mrs_01_2104__en-us_topic_0000001219231125_b109829968942130">setquota</strong> /<em id="mrs_01_2104__en-us_topic_0000001219231125_i122457692942130">znode</em> <strong id="mrs_01_2104__en-us_topic_0000001219231125_b127245150042130">-n</strong> <em id="mrs_01_2104__en-us_topic_0000001219231125_i135149301442130">number</em> <strong id="mrs_01_2104__en-us_topic_0000001219231125_b60853078342130">-b</strong> <em id="mrs_01_2104__en-us_topic_0000001219231125_i1477092942130">byte</em> command.</span><p><ul id="mrs_01_2104__en-us_topic_0000001219231125_ul9908122911111"><li id="mrs_01_2104__en-us_topic_0000001219231125_li6908629181113"><em id="mrs_01_2104__en-us_topic_0000001219231125_i6661310242130">znode</em> indicates the node for which you want to set a quota.</li><li id="mrs_01_2104__en-us_topic_0000001219231125_li79085297111"><em id="mrs_01_2104__en-us_topic_0000001219231125_i123651800742130">number</em> indicates the maximum number of nodes and subnodes.</li><li id="mrs_01_2104__en-us_topic_0000001219231125_li5908829131117"><em id="mrs_01_2104__en-us_topic_0000001219231125_i33808841442130">byte</em> indicates the maximum byte space for the node and subnodes.</li></ul>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_2092.html">Using ZooKeeper</a></div>
|
|
</div>
|
|
</div>
|
|
|