Yang, Tong 6182f91ba8 MRS component operation guide_normal 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>
2022-12-09 14:55:21 +00:00

44 lines
5.7 KiB
HTML

<a name="mrs_01_1611"></a><a name="mrs_01_1611"></a>
<h1 class="topictitle1">Performing an HBase DR Active/Standby Cluster Switchover</h1>
<div id="body1595926919575"><div class="section" id="mrs_01_1611__s53289ebf94c4495bad6a7b5f0bdf4edb"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_1611__a11ca6861b62a42bfadb318cdcb586f8a">The HBase cluster in the current environment is a DR cluster. Due to some reasons, the active and standby clusters need to be switched over. That is, the standby cluster becomes the active cluster, and the active cluster becomes the standby cluster.</p>
<div class="note" id="mrs_01_1611__note1286611300323"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_1611__p1486614300321">This section applies to MRS 3.<em id="mrs_01_1611__i1358183035712">x</em> or later clusters.</p>
</div></div>
</div>
<div class="section" id="mrs_01_1611__se21cde50595c4286a16f821006c57ffd"><h4 class="sectiontitle">Impact on the System</h4><p id="mrs_01_1611__ab0bf68ac360e447cbaffb48376d0d2f7">After the active and standby clusters are switched over, data cannot be written to the original active cluster, and the original standby cluster becomes the active cluster to take over upper-layer services.</p>
</div>
<div class="section" id="mrs_01_1611__s1b489000fac747cfa292bbc1e0fe80d0"><h4 class="sectiontitle">Procedure</h4><p id="mrs_01_1611__p107301018317"><strong id="mrs_01_1611__b5366133319148">Ensuring that upper-layer services are stopped</strong></p>
<ol id="mrs_01_1611__ol11575343141213"><li id="mrs_01_1611__li15575134315124"><span>Ensure that the upper-layer services have been stopped. If not, perform operations by referring to <a href="mrs_01_1610.html">Performing an HBase DR Service Switchover</a>.</span></li></ol>
<p id="mrs_01_1611__p17204203781220"><strong id="mrs_01_1611__b19124195315146">Disabling the write function of the active cluster</strong></p>
<ol start="2" id="mrs_01_1611__ol1613349866"><li id="mrs_01_1611__li1209125105510"><span>Download and install the HBase client.</span><p><p id="mrs_01_1611__li02102155617p0"></p>
</p></li><li id="mrs_01_1611__li9613194914620"><span>On the HBase client of the standby cluster, run the following command as user <strong id="mrs_01_1611__b1411624012157">hbase</strong> to disable the data write function of the standby cluster:</span><p><p id="mrs_01_1611__p9442713131011"><strong id="mrs_01_1611__b1457820151017">kinit hbase</strong></p>
<p id="mrs_01_1611__p141344525917"><strong id="mrs_01_1611__b14134165211917">hbase shell</strong></p>
<p id="mrs_01_1611__p261319492069"><strong id="mrs_01_1611__b10171115212107">set_clusterState_standby</strong></p>
<p id="mrs_01_1611__p861310498619">The command is run successfully if the following information is displayed:</p>
<pre class="screen" id="mrs_01_1611__screen1361314491661">hbase(main):001:0&gt; <strong id="mrs_01_1611__b4387633161116">set_clusterState_standby</strong>
=&gt; true</pre>
</p></li></ol>
<p id="mrs_01_1611__p38797546611"><strong id="mrs_01_1611__b111022412162">Checking whether the active/standby synchronization is complete</strong></p>
<ol start="4" id="mrs_01_1611__ol15820612119"><li id="mrs_01_1611__li88208112111"><span>Run the following command to ensure that the current data has been synchronized (SizeOfLogQueue=0 and SizeOfLogToReplicate=0 are required). If the values are not 0, wait and run the following command repeatedly until the values are 0.</span><p><p id="mrs_01_1611__p5225090614597"><strong id="mrs_01_1611__b49611414597">status 'replication'</strong></p>
</p></li></ol>
<p id="mrs_01_1611__p6403123311131"><strong id="mrs_01_1611__b731817191612">Disabling synchronization between the active and standby clusters</strong></p>
<ol start="5" id="mrs_01_1611__ol1613917551411"><li id="mrs_01_1611__li6138155111412"><span>Query all synchronization clusters and obtain the value of <strong id="mrs_01_1611__b1787118141611">PEER_ID</strong>.</span><p><p id="mrs_01_1611__p543958715158"><strong id="mrs_01_1611__b106835601521">list_peers</strong></p>
</p></li><li id="mrs_01_1611__li413845131413"><span>Delete all synchronization clusters.</span><p><p id="mrs_01_1611__p5138125161418"><strong id="mrs_01_1611__b17911122218161">remove_peer</strong> <em id="mrs_01_1611__i49163222163">'Standby cluster ID'</em></p>
<p id="mrs_01_1611__p3280458015219">Example:</p>
<p id="mrs_01_1611__p14138145151410"><strong id="mrs_01_1611__b24261134101349">remove_peer </strong><em id="mrs_01_1611__i2167904315321"><strong id="mrs_01_1611__b5826295715321">'</strong>1<strong id="mrs_01_1611__b3241262615225">'</strong></em></p>
</p></li><li id="mrs_01_1611__li61381851142"><span>Query all synchronized tables.</span><p><p id="mrs_01_1611__p3447385115238"><strong id="mrs_01_1611__b2562831315242">list_replicated_tables</strong></p>
</p></li><li id="mrs_01_1611__li2013917581420"><span>Disable all synchronized tables queried in the preceding step.</span><p><p id="mrs_01_1611__p11139752142"><strong id="mrs_01_1611__b234043019166">disable_table_replication</strong> <em id="mrs_01_1611__i1634473020166">'Table name'</em></p>
<p id="mrs_01_1611__p12139155131416">Example:</p>
<p id="mrs_01_1611__p2231426515253"><strong id="mrs_01_1611__b2770004715311">disable_table_replication</strong><em id="mrs_01_1611__i4939490515314"> 't1'</em></p>
</p></li></ol>
<p id="mrs_01_1611__p277348111418"><strong id="mrs_01_1611__b1717973371620">Performing an active/standby switchover</strong></p>
<ol start="9" id="mrs_01_1611__ol637205191417"><li id="mrs_01_1611__li20372451101410"><span>Reconfigure HBase DR. For details, see <a href="mrs_01_1609.html">Configuring HBase DR</a>.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0500.html">Using HBase</a></div>
</div>
</div>