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>
219 lines
49 KiB
HTML
219 lines
49 KiB
HTML
<a name="mrs_01_0368"></a><a name="mrs_01_0368"></a>
|
|
|
|
<h1 class="topictitle1">Using HBase from Scratch</h1>
|
|
<div id="body8662426"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p8060118">HBase is a column-based distributed storage system that features high reliability, performance, and scalability. This section describes how to use HBase from scratch, including how to update the client on the Master node in the cluster, create a table using the client, insert data in the table, modify the table, read data from the table, delete table data, and delete the table.</p>
|
|
<div class="section" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_s8fc13f1c40ea4f149989758261fb40e6"><h4 class="sectiontitle">Background</h4><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_aa6bb651d9fdc48249b2e258e8dd36987">Suppose a user develops an application to manage users who use service A in an enterprise. The procedure of operating service A on the HBase client is as follows:</p>
|
|
<ul id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ufb6be56b34b24b42b414a82f147e9483"><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le7f87bd280e6448fb638db9a748aefdf">Create the <strong id="mrs_01_0368__b9779227184210">user_info</strong> table.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_lee40db3e7049462584b60ba65919ab05">Add users' educational backgrounds and titles to the table.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l4f59951cb9de4db4a0920a457495ebba">Query user names and addresses by user ID.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l7d373338426f4febaaf45a15f944c52b">Query information by user name.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l8ab9b590395d415dad6d4911d2e0b6cd">Deregister users and delete user data from the user information table.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l0caa82526a5a4227909b3c75691ae936">Delete the user information table after service A ends.</li></ul>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_table27353390"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_table27353390"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_table27353390" frame="border" border="1" rules="all"><caption><b>Table 1 </b>User information</caption><thead align="left"><tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row32789387"><th align="left" class="cellrowborder" valign="top" width="19.998000199980005%" id="mcps1.3.3.2.6.1.1"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p38694667"><strong id="mrs_01_0368__b279113813430">ID</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.678432156784321%" id="mcps1.3.3.2.6.1.2"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p22689808"><strong id="mrs_01_0368__b20619199104320">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.558244175582445%" id="mcps1.3.3.2.6.1.3"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p32089967"><strong id="mrs_01_0368__b13822131154310">Gender</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.2984701529847%" id="mcps1.3.3.2.6.1.4"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p39701876"><strong id="mrs_01_0368__b16628181215439">Age</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="31.46685331466853%" id="mcps1.3.3.2.6.1.5"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p18747312"><strong id="mrs_01_0368__b858521318438">Address</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row43691456"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p49347015">12005000201</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p37685299">A</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p32610412">Male</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p24197721">19</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p13858403">City A</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row57616766"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p36446461">12005000202</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p66482253">B</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p16353430">Female</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p49559423">23</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p54890288">City B</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row24250547"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p18137316">12005000203</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p59836530">C</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p14920772">Male</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p623043">26</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p50466518">City C</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row51545483"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p14434584">12005000204</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p28350637">D</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p14700275">Male</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p49871633">18</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p13070512">City D</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row50525752"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p66054074">12005000205</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p48779793">E</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p58849189">Female</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p2055005">21</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p32237730">City E</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row21704116"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p13202999">12005000206</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p62809978">F</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p54443429">Male</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p47841633">32</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p49967061">City F</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row47050372"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p52983808">12005000207</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p63830089">G</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p2854726">Female</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p29906272">29</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p6488958">City G</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row58400626"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p32830290">12005000208</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p42007851">H</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p47192740">Female</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p64515557">30</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p58377623">City H</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row55636561"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p10267631">12005000209</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p26371793">I</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p55740512">Male</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p18687619">26</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p37302179">City I</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_row175293"><td class="cellrowborder" valign="top" width="19.998000199980005%" headers="mcps1.3.3.2.6.1.1 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p14198754">12005000210</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.678432156784321%" headers="mcps1.3.3.2.6.1.2 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p9248440">J</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.558244175582445%" headers="mcps1.3.3.2.6.1.3 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p10926182">Male</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.2984701529847%" headers="mcps1.3.3.2.6.1.4 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p12605589">25</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.46685331466853%" headers="mcps1.3.3.2.6.1.5 "><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p14419821">City J</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="section" id="mrs_01_0368__section16144125273517"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_0368__p1797113171213">The client has been installed. For example, the client is installed in the <strong id="mrs_01_0368__b5461726173811">/opt</strong><strong id="mrs_01_0368__b1346112610388"></strong><strong id="mrs_01_0368__b114617267382">/client</strong> directory. The client directory in the following operations is only an example. Change it to the actual installation directory. Before using the client, download and update the client configuration file, and ensure that the active management node of Manager is available.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_sa545593fee0d4deda232a76a7db99db4"><h4 class="sectiontitle">Procedure</h4><p id="mrs_01_0368__p13444173135518">For versions earlier than MRS 3.x, perform the following operations:</p>
|
|
<ol id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_o4aea6ac002494d60a743261275ffd54d"><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l6b58a848ef0f4fe6a361d4ef0ac39fb8"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l6b58a848ef0f4fe6a361d4ef0ac39fb8"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_l6b58a848ef0f4fe6a361d4ef0ac39fb8"></a><span>Download the client configuration file.</span><p><ol type="a" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_o10934933c3364550a0be5195fbfc2f32"><li id="mrs_01_0368__li1799392319436">Log in to MRS Manager. For details, see <a href="mrs_01_2123.html">Accessing Manager</a>. Then, choose <strong id="mrs_01_0368__b1956411591614">Services</strong>.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le025c1892e7147e290dff3b94a1d0393">Click <span class="uicontrol" id="mrs_01_0368__uicontrol103217557504"><b>Download Client</b></span>.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a05a2dba8ee714c9490116ce98af9b812">Set <span class="parmname" id="mrs_01_0368__parmname172174244519"><b>Client Type</b></span> to <span class="parmvalue" id="mrs_01_0368__parmvalue2222224155111"><b>Only configuration files</b></span>, <span class="parmname" id="mrs_01_0368__parmname51031226112316"><b>Download To</b></span> to <span class="parmvalue" id="mrs_01_0368__parmvalue5222122414515"><b>Server</b></span>, and click <span class="uicontrol" id="mrs_01_0368__uicontrol422212475119"><b>OK</b></span> to generate the client configuration file. The generated file is saved in the <strong id="mrs_01_0368__b9222624175112">/tmp/MRS-client</strong> directory on the active management node by default. You can customize the file path.</p>
|
|
</li></ol>
|
|
</p></li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l5b697da80f724b049e94ef386ccc134d"><span>Log in to the active management node of MRS Manager.</span><p><ol type="a" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_oad0dd0b610c34488815d2b07e4656c11"><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l52f4be0ff6434297a1b84c6a772a9828">On the <span class="wintitle" id="mrs_01_0368__wintitle2051224969143126"><b>Node</b></span> tab page, view the <strong id="mrs_01_0368__b842352706143150">Name</strong> parameter. The node that contains <span class="parmvalue" id="mrs_01_0368__parmvalue2050481242143221"><b>master1</b></span> in its name is the Master1 node. The node that contains <span class="parmvalue" id="mrs_01_0368__parmvalue819447924143256"><b>master2</b></span> in its name is the Master2 node.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a2f41d2e8a2434da2a56a6f48035e2d15">The active and standby management nodes of MRS Manager are installed on Master nodes by default. Because Master1 and Master2 are switched over in active and standby mode, Master1 is not always the active management node of MRS Manager. Run a command in Master1 to check whether Master1 is active management node of MRS Manager. For details about the command, see <a href="#mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le8e7045cece741e8b6209b929a50ff22">2.d</a>.</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_lad0d75a7717442b68338881c7c895c81">Log in to the Master1 node using the password as user <strong id="mrs_01_0368__b1563722621918">root</strong>. For details, see <a href="https://docs.otc.t-systems.com/usermanual/mrs/mrs_01_0083.html" target="_blank" rel="noopener noreferrer">Logging In to an ECS</a>.</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l96479867566a4bd59da83a86f87373ef">Run the following commands to switch to user <strong id="mrs_01_0368__b773124319532">omm</strong>:<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_adbc6f7bd4142423a89ea39d9d7347674"><strong id="mrs_01_0368__b946729183115">sudo su - root</strong></p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a09516e4f38e44d8085ab1e7b041fddc0"><strong id="mrs_01_0368__b517515173116">su - omm</strong></p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le8e7045cece741e8b6209b929a50ff22"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le8e7045cece741e8b6209b929a50ff22"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_le8e7045cece741e8b6209b929a50ff22"></a>Run the following command to check the active management node of MRS Manager:<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ae3cb33a0b8a7477c92f6b05767f136c3"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le8e7045cece741e8b6209b929a50ff22"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_le8e7045cece741e8b6209b929a50ff22"></a><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_c73101799356c44f6a213b083c96e3df0">sh ${BIGDATA_HOME}/om-0.0.1/sbin/status-oms.sh</span></b></p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a2e14fbc736604468bd7585d96245cd58">In the command output, the node whose <span class="parmname" id="mrs_01_0368__parmname182280010586"><b>HAActive</b></span> is <span class="parmvalue" id="mrs_01_0368__parmvalue42331702587"><b>active</b></span> is the active management node, and the node whose <span class="parmname" id="mrs_01_0368__parmname1423317014584"><b>HAActive</b></span> is <span class="parmvalue" id="mrs_01_0368__parmvalue1523317013581"><b>standby</b></span> is the standby management node. In the following example, <strong id="mrs_01_0368__b20233204585">mgtomsdat-sh-3-01-1</strong> is the active management node, and <strong id="mrs_01_0368__b142348035812">mgtomsdat-sh-3-01-2</strong> is the standby management node.</p>
|
|
<pre class="screen" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_sd906fdd3601748af837ddf8172bd0e75">Ha mode
|
|
double
|
|
NodeName HostName HAVersion StartTime HAActive HAAllResOK HARunPhase
|
|
192-168-0-30 mgtomsdat-sh-3-01-1 V100R001C01 2019-11-18 23:43:02 <strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a62984b3e97d740d3bc709bb1da033a2f">active</strong> normal Actived
|
|
192-168-0-24 mgtomsdat-sh-3-01-2 V100R001C01 2019-11-21 07:14:02 <strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a0e295160fa664c039307227c54701117">standby</strong> normal Deactived</pre>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_lde3b2ea113c34b4687592dfdc8b454c2">Log in to the active management node, for example, <span class="parmvalue" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_p4fa8933886834ca8854b5d0617f23f10"><b>192-168-0-30</b></span> of MRS Manager as user <strong id="mrs_01_0368__b15755203051811">root</strong>, and run the following command to switch to user <strong id="mrs_01_0368__b1426520364189">omm</strong>:<p id="mrs_01_0368__p646554163014"><strong id="mrs_01_0368__b277316488327">sudo su - omm</strong></p>
|
|
</li></ol>
|
|
</p></li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l187b3ef7d91249bfb5f68eec47153c36"><span>Run the following command to switch to the client installation directory, for example, <span class="filepath" id="mrs_01_0368__filepath102271523514"><b>/opt/client</b></span>:</span><p><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p357910583196"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_c80d51658ea4842c68f915afed0247987">cd /opt/client</span></b></p>
|
|
</p></li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_lc39cdd52f6ac479ab273ecabbffd083b"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_lc39cdd52f6ac479ab273ecabbffd083b"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_lc39cdd52f6ac479ab273ecabbffd083b"></a><span>Run the following command to update the client configuration for the active management node.</span><p><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p4610751203"><strong id="mrs_01_0368__b2643183718614">sh refreshConfig.sh /opt/client</strong> <i><span class="varname" id="mrs_01_0368__varname42077435588">Full path of the client configuration file package</span></i></p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p461020511200">For example, run the following command:</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p556680571064"><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a016ef072f6994457ba8c4988faa524b6">sh refreshConfig.sh /opt/client /tmp/MRS-</strong><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_af1eae3cb3bf449269db10c1df25194d9">c</strong><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a2b344f9e4a0c41ed8194dc65b9fbcc6f">lient/MRS_Services_Client.tar</strong></p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p661075172018">If the following information is displayed, the configurations have been updated successfully.</p>
|
|
<pre class="screen" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_s38bfe3be413e4853bb9d0ee12353c8d4">ReFresh components client config is complete.
|
|
Succeed to refresh components client config.</pre>
|
|
<div class="note" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_n7db6fa88e8fe4d84916aa5e228335142"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p613218111518">You can refer to steps <a href="#mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l6b58a848ef0f4fe6a361d4ef0ac39fb8">1</a> to <a href="#mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_lc39cdd52f6ac479ab273ecabbffd083b">4</a> or Method 2 in <a href="https://docs.otc.t-systems.com/en-us/usermanual/mrs/mrs_01_0089.html" target="_blank" rel="noopener noreferrer">Updating a Client</a>.</p>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l6556791324fa484e91dc201b480e3115"><span>Use the client on a Master node.</span><p><ol type="a" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_od49292eae1f845e8a383e761ce0ce2f7"><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_led80939ae6024a9ba8841d649d5132b4">On the active management node where the client is updated, for example, node <span class="parmvalue" id="mrs_01_0368__parmvalue63001169215"><b>192-168-0-30</b></span>, run the following command to go to the client directory:<p id="mrs_01_0368__p852420598612"><strong id="mrs_01_0368__b796522518712">cd /opt/client</strong></p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ldf91db8293354ac4beabdf4679eb0034">Run the following command to configure environment variables:<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p711917124619"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ldf91db8293354ac4beabdf4679eb0034"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_ldf91db8293354ac4beabdf4679eb0034"></a><strong id="mrs_01_0368__b09435016338">source bigdata_env</strong></p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le6f90e19da384d2689c1b5ca5896f874">If Kerberos authentication is enabled for the current cluster, run the following command to authenticate the current user. The current user must have the permission to create HBase tables. If Kerberos authentication is disabled for the current cluster, skip this step.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_aeaf76195462f4119af05c698566aba09"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_le6f90e19da384d2689c1b5ca5896f874"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_le6f90e19da384d2689c1b5ca5896f874"></a><strong id="mrs_01_0368__b63065667193458">kinit</strong> <em id="mrs_01_0368__i6148471145146">MRS cluster user</em></p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p809043511651">For example, <strong id="mrs_01_0368__b139531465310">kinit hbaseuser</strong>.</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_li8119414469">Run the following HBase client command:<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ae866cfe594424869bd57657b6921e1a8"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_li8119414469"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_li8119414469"></a><strong id="mrs_01_0368__b5559429123314">hbase shell</strong></p>
|
|
</li></ol>
|
|
</p></li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l72325514221f4c47905ce1a811f630c6"><span>Run the following commands on the HBase client to implement service A.</span><p><ol type="a" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_o49ed6b6bfa07416b84436509495353cc"><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_leff73fdf0f7249d7860295f1ec5a040a">Create the <strong id="mrs_01_0368__b1892014515416">user_info</strong> user information table according to <a href="#mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_table27353390">Table 1</a> and add data to it.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a7623622063a341718c8657297dd100b8"><strong id="mrs_01_0368__b676403473312">create</strong> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_vac1206098b27480e994a464e9cd24eae">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__cmdname71111839133316">NAME</span></b> => 'i'}</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a632c54e6710048bc9f8184fe7fa1a052">For example, to add information about the user whose ID is 12005000201, run the following commands:</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a7b5bb037eacd4b42a8edf14963802707"><b><span class="cmdname" id="mrs_01_0368__cmdname11921114314335">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_vd8d67d2b216246dca464164dd7380783">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_va87bb3efa36e456a84f4ef912c369a5d">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a13fc4324b0234bfeaa1821cd45596c8f"><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_aa0362304fb854f5e93ffa76a850396dc">i:name</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v345c6da428d8444fbfddd091b0d632eb">A</span></i>'</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ab7a7e98729744258b3e09764f4db3d94"><b><span class="cmdname" id="mrs_01_0368__cmdname1259224923310">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v93a7a32f56ec44b98589c92dc79f305d">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_vd55904ca5d92435db04066a9d0a288bd">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ac20ac7b5e43b4d6688d18ea3c6741a00"><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ad2d6ac1099e1456cb067d39a0c53dec8">i:gender</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_vd158e89afd1a4c3193ba5495bf2e520e">Male</span></i>'</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_aa7b65e28bef5493faf5c6f11bb7bcd26"><b><span class="cmdname" id="mrs_01_0368__cmdname10599185318339">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v1802a7a1bb1c4530ae6a51fbfe2da275">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v178e4596f9154eae8593189aeb1c7c3e">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a35d96cc91f8e448f982ff099f7670c74"><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_add6340fbd3354fe1b4ad21cf5e11c04f">i:age</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v8213f2e0170840f9a95f086dbddec372">19</span></i>'</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a64f0bafbae8e46a0b1372c4b849793cf"><b><span class="cmdname" id="mrs_01_0368__cmdname997817575335">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v79eb459bbdda4e42a8fd889f8cb3a7df">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v775b6e6f03e540f886395d553a4ec175">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a17590b72a8b14c43b0617b4135a4c220"><strong id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a03cd0224bf234a6990db960def5e1090">i:address</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v24f0cf38ff5841f0b1a68f5b98dffbbf">City A</span></i>'</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l2be54450a3a640a3bdabc00600059a0c">Add users' educational backgrounds and titles to the <strong id="mrs_01_0368__b19990182419412">user_info</strong> table.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ac3d628b5c61e4c8f9309e37011e3ead1">For example, to add educational background and title information about user 12005000201, run the following commands:</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a13db09a8b2cf4d5aace73056f62e1f71"><b><span class="cmdname" id="mrs_01_0368__cmdname1622017393416">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_va4edf2e10bb0499b9fa51b4651ef8961">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v8d442d0cfc004314ba627c4d5dc23888">12005000201</span></i>','<b><span class="cmdname" id="mrs_01_0368__cmdname13333197133410">i:degree</span></b>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v5a9e4f4a1d2e4c4baacfff22ed33cb11">master</span></i>'</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a9f2168b804754833b6cae9e5d04fe131"><b><span class="cmdname" id="mrs_01_0368__cmdname7553161433411">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v4be2e46831644d5c93efdabc9297e2c2">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v4bd2e03b60b844b8bf1e27c50f47bb32">12005000201</span></i>','<b><span class="cmdname" id="mrs_01_0368__cmdname20865619133413">i:pose</span></b>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v5a091d93d93a4a88868dac9d917da6b9">manager</span></i>'</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l29004d89823244708197502874e0fc21">Query user names and addresses by user ID.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_af5ff71bfed8b4536b043977b20347d75"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l29004d89823244708197502874e0fc21"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_l29004d89823244708197502874e0fc21"></a>For example, to query the name and address of user 12005000201, run the following command:</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_aca0213f4f23a47efaae70d3c39a378b6"><b><span class="cmdname" id="mrs_01_0368__cmdname161561826203414">scan</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v812525832bba42b4877893488b67d21f">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__cmdname86421531183416">STARTROW</span></b>=>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v40dfcf0355b44a809a9cadbc39e0a042">12005000201</span></i>',<b><span class="cmdname" id="mrs_01_0368__cmdname45458364342">STOPROW</span></b>=>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v220b6a5e69db47908d62470846cbc703">12005000201</span></i>',<b><span class="cmdname" id="mrs_01_0368__cmdname20332124110342">COLUMNS</span></b>=>['<b><span class="cmdname" id="mrs_01_0368__cmdname134291446113413">i:name</span></b>','<b><span class="cmdname" id="mrs_01_0368__cmdname7735205163410">i:address</span></b>']}</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l9d24bb35d4ae42858034d65042472fd3">Query information by user name.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a1ade36b20c9243feab444af8a7acc754"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l9d24bb35d4ae42858034d65042472fd3"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_l9d24bb35d4ae42858034d65042472fd3"></a>For example, to query information about user A, run the following command:</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_aea00d154c23d4ed9b0cd2ca8868a5387"><b><span class="cmdname" id="mrs_01_0368__cmdname1356375610344">scan</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v11fa7301c2db499ea4ab9bfa8203ea67">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__cmdname12345121113518">FILTER</span></b>=>"SingleColumnValueFilter('i','name',=,'binary:<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v725a482284b741da96aeeb2919a654fa">A</span></i>')"}</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l7b3b2f0f1b1a463cb220bca0774b179b">Delete user data from the user information table.<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a0f6cc7dc065749d7b8eece9e2f6dc4d7"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l7b3b2f0f1b1a463cb220bca0774b179b"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_l7b3b2f0f1b1a463cb220bca0774b179b"></a>All user data needs to be deleted. For example, to delete data of user 12005000201, run the following command:</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_a3be588ccee794c8e882275d3236a160a"><b><span class="cmdname" id="mrs_01_0368__cmdname1175815615358">delete</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v43716040afd64687a2a1b74635cf51ef">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v4cade52d26354436b1718cfe3c3b05c8">12005000201</span></i>','i'</p>
|
|
</li><li id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l71a536c2d3c24e0db0475c20e657cd97">Delete the user information table.<p id="mrs_01_0368__p1075244171610"><a name="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_l71a536c2d3c24e0db0475c20e657cd97"></a><a name="en-us_topic_0229422393_en-us_topic_0173178212_l71a536c2d3c24e0db0475c20e657cd97"></a><b><span class="cmdname" id="mrs_01_0368__cmdname9751444171616">disable</span></b>'<i><span class="varname" id="mrs_01_0368__varname9752443169">user_info</span></i>'</p>
|
|
<p id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_ac2f7103d996442b7964024375b174f29"><b><span class="cmdname" id="mrs_01_0368__cmdname57671715143518">drop</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_v67e2f0c67b3540b18d1797970fe720eb">user_info</span></i>'</p>
|
|
</li></ol>
|
|
</p></li></ol>
|
|
<p id="mrs_01_0368__p3543825154418">For MRS 3.x or later, perform the following operations:</p>
|
|
<ol id="mrs_01_0368__ol6541192513443"><li id="mrs_01_0368__li125471325154412"><span>Use the client on the active management node.</span><p><ol type="a" id="mrs_01_0368__ol354792524413"><li id="mrs_01_0368__li9548192594420">Log in to the node where the client is installed as the client installation user and run the following command to switch to the client directory:<p id="mrs_01_0368__p254862574416"><a name="mrs_01_0368__li9548192594420"></a><a name="li9548192594420"></a><strong id="mrs_01_0368__b49171591198">cd /opt/client</strong></p>
|
|
</li><li id="mrs_01_0368__li6548112519448">Run the following command to configure environment variables:<p id="mrs_01_0368__p13548182584419"><a name="mrs_01_0368__li6548112519448"></a><a name="li6548112519448"></a><b><span class="cmdname" id="mrs_01_0368__cmdname9875143411528">source bigdata_env</span></b></p>
|
|
</li><li id="mrs_01_0368__li155485252445">If Kerberos authentication is enabled for the current cluster, run the following command to authenticate the current user. The current user must have the permission to create HBase tables. If Kerberos authentication is disabled for the current cluster, skip this step.<p id="mrs_01_0368__p14548142518442"><a name="mrs_01_0368__li155485252445"></a><a name="li155485252445"></a><strong id="mrs_01_0368__b1945491611570">kinit</strong> <em id="mrs_01_0368__i16455131615572">MRS cluster user</em></p>
|
|
<p id="mrs_01_0368__p054812512442">For example, <strong id="mrs_01_0368__b13816111912578">kinit hbaseuser</strong>.</p>
|
|
</li><li id="mrs_01_0368__li3549192519445">Run the following HBase client command:<p id="mrs_01_0368__p65499251449"><a name="mrs_01_0368__li3549192519445"></a><a name="li3549192519445"></a><b><span class="cmdname" id="mrs_01_0368__cmdname9711414195319">hbase shell</span></b></p>
|
|
</li></ol>
|
|
</p></li><li id="mrs_01_0368__li1549182594417"><span>Run the following commands on the HBase client to implement service A.</span><p><ol type="a" id="mrs_01_0368__ol1154982512449"><li id="mrs_01_0368__li554972511449">Create the <strong id="mrs_01_0368__b0722173375712">user_info</strong> user information table according to <a href="#mrs_01_0368__en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_table27353390">Table 1</a> and add data to it.<p id="mrs_01_0368__p3549202544418"><b><span class="cmdname" id="mrs_01_0368__cmdname43711519185311">create</span></b> '<i><span class="varname" id="mrs_01_0368__varname8549132564412">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__cmdname882132312539">NAME</span></b> => 'i'}</p>
|
|
<p id="mrs_01_0368__p454932584417">For example, to add information about the user whose ID is <strong id="mrs_01_0368__b1088685015715">12005000201</strong>, run the following commands:</p>
|
|
<p id="mrs_01_0368__p1554932584417"><b><span class="cmdname" id="mrs_01_0368__cmdname611511286531">put</span></b> '<i><span class="varname" id="mrs_01_0368__varname1154918256442">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname9549152554418">12005000201</span></i>','<em id="mrs_01_0368__i13549182514410"><strong id="mrs_01_0368__b1254992564417">i:name</strong></em>','<i><span class="varname" id="mrs_01_0368__varname85491325164413">A</span></i>'</p>
|
|
<p id="mrs_01_0368__p18549182514418"><b><span class="cmdname" id="mrs_01_0368__cmdname2185733105317">put</span></b> '<i><span class="varname" id="mrs_01_0368__varname5549132554418">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname125491525164414">12005000201</span></i>','<em id="mrs_01_0368__i175491625184417"><strong id="mrs_01_0368__b11549525174414">i:gender</strong></em>','<i><span class="varname" id="mrs_01_0368__varname655042514441">Male</span></i>'</p>
|
|
<p id="mrs_01_0368__p45501425104416"><b><span class="cmdname" id="mrs_01_0368__cmdname122731537125310">put</span></b> '<i><span class="varname" id="mrs_01_0368__varname555013259448">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname14550225154410">12005000201</span></i>','<em id="mrs_01_0368__i145509257448"><strong id="mrs_01_0368__b13550182524411">i:age</strong></em>','<i><span class="varname" id="mrs_01_0368__varname1555012254443">19</span></i>'</p>
|
|
<p id="mrs_01_0368__p35501025184419"><b><span class="cmdname" id="mrs_01_0368__cmdname717216414535">put</span></b> '<i><span class="varname" id="mrs_01_0368__varname555042518446">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname1455032594414">12005000201</span></i>','<em id="mrs_01_0368__i55501425174414"><strong id="mrs_01_0368__b65502256448">i:address</strong></em>','<i><span class="varname" id="mrs_01_0368__varname6550162511449">City A</span></i>'</p>
|
|
</li><li id="mrs_01_0368__li55505253444">Add users' educational backgrounds and titles to the <strong id="mrs_01_0368__b842165355719">user_info</strong> table.<p id="mrs_01_0368__p75501250441">For example, to add educational background and title information about user 12005000201, run the following commands:</p>
|
|
<p id="mrs_01_0368__p1855010251442"><b><span class="cmdname" id="mrs_01_0368__cmdname4421346155314">put</span></b> '<i><span class="varname" id="mrs_01_0368__varname1155010256448">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname1255022584410">12005000201</span></i>','<b><span class="cmdname" id="mrs_01_0368__cmdname619450135315">i:degree</span></b>','<i><span class="varname" id="mrs_01_0368__varname3550112564420">master</span></i>'</p>
|
|
<p id="mrs_01_0368__p115501525164411"><b><span class="cmdname" id="mrs_01_0368__cmdname144835455311">put</span></b> '<i><span class="varname" id="mrs_01_0368__varname6550132515448">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname355182511441">12005000201</span></i>','<b><span class="cmdname" id="mrs_01_0368__cmdname19653135785315">i:pose</span></b>','<i><span class="varname" id="mrs_01_0368__varname1355112253446">manager</span></i>'</p>
|
|
</li><li id="mrs_01_0368__li1355172574413">Query user names and addresses by user ID.<p id="mrs_01_0368__p145511625174416"><a name="mrs_01_0368__li1355172574413"></a><a name="li1355172574413"></a>For example, to query the name and address of user 12005000201, run the following command:</p>
|
|
<p id="mrs_01_0368__p85511625124417"><b><span class="cmdname" id="mrs_01_0368__cmdname16258143195418">scan</span></b>'<i><span class="varname" id="mrs_01_0368__varname6551825164419">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__cmdname1941275541">STARTROW</span></b>=>'<i><span class="varname" id="mrs_01_0368__varname1655132524416">12005000201</span></i>',<b><span class="cmdname" id="mrs_01_0368__cmdname10328171115547">STOPROW</span></b>=>'<i><span class="varname" id="mrs_01_0368__varname755162514411">12005000201</span></i>',<b><span class="cmdname" id="mrs_01_0368__cmdname13152515175420">COLUMNS</span></b>=>['<b><span class="cmdname" id="mrs_01_0368__cmdname879762415541">i:name</span></b>','<b><span class="cmdname" id="mrs_01_0368__cmdname4362152819545">i:address</span></b>']}</p>
|
|
</li><li id="mrs_01_0368__li755110252441">Query information by user name.<p id="mrs_01_0368__p1855172511442"><a name="mrs_01_0368__li755110252441"></a><a name="li755110252441"></a>For example, to query information about user A, run the following command:</p>
|
|
<p id="mrs_01_0368__p755119258442"><b><span class="cmdname" id="mrs_01_0368__cmdname8844153216546">scan</span></b>'<i><span class="varname" id="mrs_01_0368__varname13551102516445">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__cmdname15734163611542">FILTER</span></b>=>"SingleColumnValueFilter('i','name',=,'binary:<i><span class="varname" id="mrs_01_0368__varname15551625144414">A</span></i>')"}</p>
|
|
</li><li id="mrs_01_0368__li145519255441">Delete user data from the user information table.<p id="mrs_01_0368__p7551132512449"><a name="mrs_01_0368__li145519255441"></a><a name="li145519255441"></a>All user data needs to be deleted. For example, to delete data of user 12005000201, run the following command:</p>
|
|
<p id="mrs_01_0368__p755192517441"><b><span class="cmdname" id="mrs_01_0368__cmdname61611240155412">delete</span></b>'<i><span class="varname" id="mrs_01_0368__varname4551425114417">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__varname10551112512443">12005000201</span></i>','i'</p>
|
|
</li><li id="mrs_01_0368__li185511625134412">Delete the user information table.<p id="mrs_01_0368__p1950760201710"><a name="mrs_01_0368__li185511625134412"></a><a name="li185511625134412"></a><b><span class="cmdname" id="mrs_01_0368__cmdname050718010177">disable</span></b>'<i><span class="varname" id="mrs_01_0368__varname1050713014178">user_info</span></i>'</p>
|
|
<p id="mrs_01_0368__p11551325174419"><b><span class="cmdname" id="mrs_01_0368__cmdname7221114875416">drop</span></b> '<i><span class="varname" id="mrs_01_0368__varname2551152520443">user_info</span></i>'</p>
|
|
</li></ol>
|
|
</p></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>
|
|
|