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>
56 lines
7.7 KiB
HTML
56 lines
7.7 KiB
HTML
<a name="mrs_01_2100"></a><a name="mrs_01_2100"></a>
|
|
|
|
<h1 class="topictitle1">Binding the Client to an IP Address</h1>
|
|
<div id="body8662426"><div class="section" id="mrs_01_2100__en-us_topic_0000001173631022_s426792487bc54025923b4c71574946fa"><h4 class="sectiontitle">Scenarios</h4><p id="mrs_01_2100__en-us_topic_0000001173631022_a16412acf266344719a6ade908026448e">To prevent multiple IP nodes, bind the current ZooKeeper client to any available IP address. The data flow layer, management layer, and other network layers in the production environment have different IP address ranges. Bind the ZooKeeper client to the IP address at the data flow layer. This helps locate the failure scenario where the data IP address is unreachable.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_2100__en-us_topic_0000001173631022_s20bba67f9e1541ec968845da2243f693"><h4 class="sectiontitle">Configuration Description</h4><p id="mrs_01_2100__en-us_topic_0000001173631022_a04dbd3f3e14a47b5bc352240ae549be5">Configure <span class="parmname" id="mrs_01_2100__en-us_topic_0000001173631022_p7baf639efcdd49f3a25159a92d8280ff"><b>zookeeper.client.bind.address</b></span> to ensure that the client is always bound to the specified IP address. To set <strong id="mrs_01_2100__en-us_topic_0000001173631022_b127150750842334">zookeeper.client.bind.address</strong> to <em id="mrs_01_2100__en-us_topic_0000001173631022_i72825778842334">X</em>, set <span class="parmname" id="mrs_01_2100__en-us_topic_0000001173631022_pc0fefb8584784308856f3563d7321773"><b>-Dzookeeper.client.bind.address</b></span> to <em id="mrs_01_2100__en-us_topic_0000001173631022_i122406916442334">X</em> when starting the ZooKeeper client.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_2100__en-us_topic_0000001173631022_t35c1bbc4c5d34360a27a97b724f03988" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="mrs_01_2100__en-us_topic_0000001173631022_rbdf2c0266483418eb44a9c4efcf29f7b"><th align="left" class="cellrowborder" valign="top" width="15.229999999999999%" id="mcps1.3.2.3.2.5.1.1"><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p203516858038"><strong id="mrs_01_2100__en-us_topic_0000001173631022_a2a524952e8ca45cebaa2726acadc84a5">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.920000000000002%" id="mcps1.3.2.3.2.5.1.2"><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p53195248038">System Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="52.31%" id="mcps1.3.2.3.2.5.1.3"><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p527284328038"><strong id="mrs_01_2100__en-us_topic_0000001173631022_a9955c83bd52e4bf2947aa479eee3734b">Description</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.54%" id="mcps1.3.2.3.2.5.1.4"><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p527573478038"><strong id="mrs_01_2100__en-us_topic_0000001173631022_a1cec16936eb44e19a0e3bf58e755c77e">Default Value</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_2100__en-us_topic_0000001173631022_r682cc7d81d024503a43b2a0121234296"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.2.3.2.5.1.1 "><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p80608878038">zookeeper.client.bind.address</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.920000000000002%" headers="mcps1.3.2.3.2.5.1.2 "><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p489521108038">zookeeper.client.bind.address</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.31%" headers="mcps1.3.2.3.2.5.1.3 "><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p56979658038">Optional. IP address or host name bound to the ZooKeeper client. By default, the ZooKeeper client is bound to any available IP address in the system.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.54%" headers="mcps1.3.2.3.2.5.1.4 "><p id="mrs_01_2100__en-us_topic_0000001173631022_en-us_topic_0039590406_p588820458038">-</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_2100__en-us_topic_0000001173631022_section963115211036"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_2100__en-us_topic_0000001173631022_ol101807581094"><li id="mrs_01_2100__en-us_topic_0000001173631022_li131791258691"><span>Log in to the node where the client is installed as the client installation user.</span></li><li id="mrs_01_2100__en-us_topic_0000001173631022_li12179158995"><span>Run the following command to switch to the client installation directory:</span><p><p id="mrs_01_2100__en-us_topic_0000001173631022_p517920581292"><strong id="mrs_01_2100__en-us_topic_0000001173631022_b14179258595">cd</strong> <strong id="mrs_01_2100__en-us_topic_0000001173631022_b717935812915">/opt/client</strong></p>
|
|
</p></li><li id="mrs_01_2100__en-us_topic_0000001173631022_li10180115819915"><span>Run the following command to edit the <strong id="mrs_01_2100__en-us_topic_0000001173631022_b05215511518">component_env</strong> file:</span><p><p id="mrs_01_2100__en-us_topic_0000001173631022_p917945812912"><strong id="mrs_01_2100__en-us_topic_0000001173631022_b181791658393">vi ZooKeeper/component_env</strong></p>
|
|
<p id="mrs_01_2100__en-us_topic_0000001173631022_p11799581195">Add the <span class="parmname" id="mrs_01_2100__en-us_topic_0000001173631022_parmname1217919582911"><b>zookeeper.client.bind.address</b></span> parameter and its value.</p>
|
|
<p id="mrs_01_2100__en-us_topic_0000001173631022_p101790582913">Normal mode:</p>
|
|
<pre class="screen" id="mrs_01_2100__en-us_topic_0000001173631022_screen018017581996">export ZOOKEEPER_HOME="/opt/client/ZooKeeper/zookeeper"
|
|
PATH_NEW=`echo $PATH | sed "s|:$ZOOKEEPER_HOME/bin||g" | sed "s|$ZOOKEEPER_HOME/bin:||g"`
|
|
export PATH="$ZOOKEEPER_HOME/bin:$PATH_NEW"
|
|
# default heap for zookeeper client
|
|
export ZK_CLIENT_HEAP="256"
|
|
export CLIENT_JVMFLAGS="-Xmx${ZK_CLIENT_HEAP}m"
|
|
export CLIENT_JVMFLAGS="$CLIENT_JVMFLAGS -Dzookeeper.root.logger=WARN,CONSOLE -Dzookeeper.request.timeout=120000 -Dzookeeper.client.bind.address=<em id="mrs_01_2100__en-us_topic_0000001173631022_i1662245082117">X</em>" #Add a parameter. <em id="mrs_01_2100__en-us_topic_0000001173631022_i473113526522">X</em> indicates the configured IP address.</pre>
|
|
<p id="mrs_01_2100__en-us_topic_0000001173631022_p141800580920">Security mode:</p>
|
|
<pre class="screen" id="mrs_01_2100__en-us_topic_0000001173631022_screen1818015811920">if [ "$HADOOP_SECURITY_AUTHENTICATION" = "kerberos" ]; then
|
|
default_realm=`cat $KRB5_CONFIG |grep default_realm|awk -F"=" '{gsub(" ","");print $2}'|tr 'A-Z' 'a-z'`
|
|
export ZOO_SERVER_PRINCIPAL="zookeeper/hadoop.${default_realm}"
|
|
export CLIENT_JVMFLAGS=" ${CLIENT_JVMFLAGS} -Djava.security.krb5.conf=$KRB5_CONFIG -Dzookeeper.kin -Dzookeeper.client.bind.address=<em id="mrs_01_2100__en-us_topic_0000001173631022_i280815312119">X</em>" #Add a parameter. <em id="mrs_01_2100__en-us_topic_0000001173631022_i11771132395318">X</em> indicates the configured IP address.</pre>
|
|
</p></li></ol><ol start="4" id="mrs_01_2100__en-us_topic_0000001173631022_ol1717995814913"><li id="mrs_01_2100__en-us_topic_0000001173631022_li117995813912"><span>Run the <strong id="mrs_01_2100__en-us_topic_0000001173631022_b9932143113537">:wq</strong> command to save execution.</span></li><li id="mrs_01_2100__en-us_topic_0000001173631022_li1617913581091"><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>
|
|
|