Yang, Tong 3f5759eed2 MRS comp-lts 2.0.38.SP20 version
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>
2023-01-19 17:08:45 +00:00

45 lines
6.9 KiB
HTML

<a name="mrs_01_2099"></a><a name="mrs_01_2099"></a>
<h1 class="topictitle1">Configuring ZooKeeper Response Timeout Interval</h1>
<div id="body8662426"><div class="section" id="mrs_01_2099__en-us_topic_0000001219230849_s41843b34a3c64c368378a231aad677d7"><h4 class="sectiontitle">Scenarios</h4><p id="mrs_01_2099__en-us_topic_0000001219230849_acf51eb6a78e44086aa73d82819975342">The ZooKeeper client uses the FIFO queue to send a request to the server and waits for a response from the server. The client maintains the FIFO queue until it acknowledges the server's response to the request. The client waits indefinitely before acknowledging the response from the server. If the client cannot receive a response due to a server or network fault, the client enters the suspended state. Therefore, to avoid infinite waiting time, the client needs to associate with the ACK response timeout.</p>
<div class="fignone" id="mrs_01_2099__en-us_topic_0000001219230849_ff1692b667312442d82ec7055aa4c995c"><span class="figcap"><b>Figure 1 </b>Request timeout logic</span><br><span><img id="mrs_01_2099__en-us_topic_0000001219230849_image16988173019374" src="en-us_image_0000001296219696.png"></span></div>
</div>
<div class="section" id="mrs_01_2099__en-us_topic_0000001219230849_sdd091bfdfc3f485b8655ddcc2ad602bd"><h4 class="sectiontitle">Configuration Description</h4><p id="mrs_01_2099__en-us_topic_0000001219230849_a7a6e25743431470ab71d1731b5a4abd3">Change the value of <span class="parmname" id="mrs_01_2099__en-us_topic_0000001219230849_p6187758fd94f41edbb9ddb5642b5bcdd"><b>zookeeper.request.timeout</b></span> based on the network latency. If the packet loss duration is greater than the default value <span class="parmvalue" id="mrs_01_2099__en-us_topic_0000001219230849_p659ae8b6e5ca462b8cedfb094a96bbf5"><b>120000 ms</b></span>, set this parameter to a larger value. To set <span class="parmname" id="mrs_01_2099__en-us_topic_0000001219230849_p90f0277a96e942b19789fa7985ae7596"><b>zookeeper.request.timeout</b></span> to <em id="mrs_01_2099__en-us_topic_0000001219230849_i6632904314252">X</em>, set <strong id="mrs_01_2099__en-us_topic_0000001219230849_b1457560944252">Dzookeeper.request.timeout</strong> to <em id="mrs_01_2099__en-us_topic_0000001219230849_i13053602514252">X</em> when starting the ZooKeeper client.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_2099__en-us_topic_0000001219230849_t1ba44033f8724703a02cf78558134145" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response timeout duration parameters</caption><thead align="left"><tr id="mrs_01_2099__en-us_topic_0000001219230849_r640047460676475ebd6b44699c5ff05a"><th align="left" class="cellrowborder" valign="top" width="15.790000000000001%" id="mcps1.3.2.3.2.5.1.1"><p id="mrs_01_2099__en-us_topic_0000001219230849_a09be38e5095649298924dd82772cb65f"><strong id="mrs_01_2099__en-us_topic_0000001219230849_ad68f03483dc54bdfb86fb1c0d0e03d13">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.04%" id="mcps1.3.2.3.2.5.1.2"><p id="mrs_01_2099__en-us_topic_0000001219230849_a78978afae1ba4484bc3f267627a2af50">System Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.44%" id="mcps1.3.2.3.2.5.1.3"><p id="mrs_01_2099__en-us_topic_0000001219230849_acad8fb4dcc8747f4bc0520d7dd46e61a"><strong id="mrs_01_2099__en-us_topic_0000001219230849_a53c708e1cd254c70ba4b9558080453f7">Description</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.73%" id="mcps1.3.2.3.2.5.1.4"><p id="mrs_01_2099__en-us_topic_0000001219230849_a3c01c19a5803467780410dafd709fdb5"><strong id="mrs_01_2099__en-us_topic_0000001219230849_a31502cd563214391a0630619ae15d30e">Default Value</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_2099__en-us_topic_0000001219230849_rcc9d456574104055a6a838d00ff41fa7"><td class="cellrowborder" valign="top" width="15.790000000000001%" headers="mcps1.3.2.3.2.5.1.1 "><p id="mrs_01_2099__en-us_topic_0000001219230849_ab81c79359949472791f7b3c124da3661">zookeeper.request.timeout</p>
</td>
<td class="cellrowborder" valign="top" width="14.04%" headers="mcps1.3.2.3.2.5.1.2 "><p id="mrs_01_2099__en-us_topic_0000001219230849_a2dcfc124b5154b1d9391004d6399174e">zookeeper.request.timeout</p>
</td>
<td class="cellrowborder" valign="top" width="53.44%" headers="mcps1.3.2.3.2.5.1.3 "><p id="mrs_01_2099__en-us_topic_0000001219230849_aad47307c77e649e0ac976d86277ee7c7">If no response is received from the server within the configured time, terminate the request that is not responded with <strong id="mrs_01_2099__en-us_topic_0000001219230849_b8222093184252">org.apache.zookeeper.KeeperException.ConnectionLossException</strong> and exit. Unit: millisecond</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.3.2.5.1.4 "><p id="mrs_01_2099__en-us_topic_0000001219230849_a9a9fe1e64fd2499bacc97b39712d919a">120000</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_01_2099__en-us_topic_0000001219230849_section1413454617399"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_2099__en-us_topic_0000001219230849_ol151739463396"><li id="mrs_01_2099__en-us_topic_0000001219230849_li617134614398"><span>Log in to the node where the client is installed as the client installation user.</span></li><li id="mrs_01_2099__en-us_topic_0000001219230849_li1117211467396"><span>Run the following command to switch to the client installation directory:</span><p><p id="mrs_01_2099__en-us_topic_0000001219230849_p191719464397"><strong id="mrs_01_2099__en-us_topic_0000001219230849_b17171194623917">cd</strong> <strong id="mrs_01_2099__en-us_topic_0000001219230849_b111711946123913">/opt/client</strong></p>
</p></li><li id="mrs_01_2099__en-us_topic_0000001219230849_li917394613912"><span>Run the following command to edit the <strong id="mrs_01_2099__en-us_topic_0000001219230849_b16571193313469">component_env</strong> file:</span><p><p id="mrs_01_2099__en-us_topic_0000001219230849_p11721146183919"><strong id="mrs_01_2099__en-us_topic_0000001219230849_b121726467397">vi ZooKeeper/component_env</strong></p>
<p id="mrs_01_2099__en-us_topic_0000001219230849_p752913216507">Change the value of <strong id="mrs_01_2099__en-us_topic_0000001219230849_b1687817458465">zookeeper.request.timeout</strong>.</p>
<pre class="screen" id="mrs_01_2099__en-us_topic_0000001219230849_screen101721346173910">-Dzookeeper.request.timeout=120000</pre>
</p></li><li id="mrs_01_2099__en-us_topic_0000001219230849_li151731446193916"><span>Run the <strong id="mrs_01_2099__en-us_topic_0000001219230849_b202831549164613">:wq</strong> command to save execution.</span></li><li id="mrs_01_2099__en-us_topic_0000001219230849_li1173114603916"><span>Restart the client for the settings to take effect.</span></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>