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

168 lines
31 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_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_s8fc13f1c40ea4f149989758261fb40e6"><h4 class="sectiontitle">Background</h4><p id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_ufb6be56b34b24b42b414a82f147e9483"><li id="mrs_01_0368__en-us_topic_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_le7f87bd280e6448fb638db9a748aefdf">Create the <strong id="mrs_01_0368__en-us_topic_0000001173789254_b9779227184210">user_info</strong> table.</li><li id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_l7d373338426f4febaaf45a15f944c52b">Query information by user name.</li><li id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_table27353390"></a><a name="en-us_topic_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p38694667"><strong id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p22689808"><strong id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p32089967"><strong id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p39701876"><strong id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_en-us_topic_0037446806_p18747312"><strong id="mrs_01_0368__en-us_topic_0000001173789254_b858521318438">Address</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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_0000001173789254_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__en-us_topic_0000001173789254_section16144125273517"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_0368__en-us_topic_0000001173789254_p1797113171213">The client has been installed. For example, the client is installed in the <strong id="mrs_01_0368__en-us_topic_0000001173789254_b5461726173811">/opt</strong><strong id="mrs_01_0368__en-us_topic_0000001173789254_b1346112610388"></strong><strong id="mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_en-us_topic_0229422393_en-us_topic_0173178212_sa545593fee0d4deda232a76a7db99db4"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_0368__en-us_topic_0000001173789254_ol6541192513443"><li id="mrs_01_0368__en-us_topic_0000001173789254_li125471325154412"><span>Use the client on the active management node.</span><p><ol type="a" id="mrs_01_0368__en-us_topic_0000001173789254_ol354792524413"><li id="mrs_01_0368__en-us_topic_0000001173789254_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__en-us_topic_0000001173789254_p254862574416"><a name="mrs_01_0368__en-us_topic_0000001173789254_li9548192594420"></a><a name="en-us_topic_0000001173789254_li9548192594420"></a><strong id="mrs_01_0368__en-us_topic_0000001173789254_b49171591198">cd /opt/client</strong></p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li6548112519448">Run the following command to configure environment variables:<p id="mrs_01_0368__en-us_topic_0000001173789254_p13548182584419"><a name="mrs_01_0368__en-us_topic_0000001173789254_li6548112519448"></a><a name="en-us_topic_0000001173789254_li6548112519448"></a><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname9875143411528">source bigdata_env</span></b></p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_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__en-us_topic_0000001173789254_p14548142518442"><a name="mrs_01_0368__en-us_topic_0000001173789254_li155485252445"></a><a name="en-us_topic_0000001173789254_li155485252445"></a><strong id="mrs_01_0368__en-us_topic_0000001173789254_b1945491611570">kinit</strong> <em id="mrs_01_0368__en-us_topic_0000001173789254_i16455131615572">MRS cluster user</em></p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p054812512442">For example, <strong id="mrs_01_0368__en-us_topic_0000001173789254_b13816111912578">kinit hbaseuser</strong>.</p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li3549192519445">Run the following HBase client command:<p id="mrs_01_0368__en-us_topic_0000001173789254_p65499251449"><a name="mrs_01_0368__en-us_topic_0000001173789254_li3549192519445"></a><a name="en-us_topic_0000001173789254_li3549192519445"></a><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname9711414195319">hbase shell</span></b></p>
</li></ol>
</p></li><li id="mrs_01_0368__en-us_topic_0000001173789254_li1549182594417"><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_0000001173789254_ol1154982512449"><li id="mrs_01_0368__en-us_topic_0000001173789254_li554972511449">Create the <strong id="mrs_01_0368__en-us_topic_0000001173789254_b0722173375712">user_info</strong> user information table according to <a href="#mrs_01_0368__en-us_topic_0000001173789254_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_0000001173789254_p3549202544418"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname43711519185311">create</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname8549132564412">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname882132312539">NAME</span></b> =&gt; 'i'}</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p454932584417">For example, to add information about the user whose ID is <strong id="mrs_01_0368__en-us_topic_0000001173789254_b1088685015715">12005000201</strong>, run the following commands:</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p1554932584417"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname611511286531">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1154918256442">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname9549152554418">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0000001173789254_i13549182514410"><strong id="mrs_01_0368__en-us_topic_0000001173789254_b1254992564417">i:name</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname85491325164413">A</span></i>'</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p18549182514418"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname2185733105317">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname5549132554418">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname125491525164414">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0000001173789254_i175491625184417"><strong id="mrs_01_0368__en-us_topic_0000001173789254_b11549525174414">i:gender</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname655042514441">Male</span></i>'</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p45501425104416"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname122731537125310">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname555013259448">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname14550225154410">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0000001173789254_i145509257448"><strong id="mrs_01_0368__en-us_topic_0000001173789254_b13550182524411">i:age</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1555012254443">19</span></i>'</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p35501025184419"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname717216414535">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname555042518446">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1455032594414">12005000201</span></i>','<em id="mrs_01_0368__en-us_topic_0000001173789254_i55501425174414"><strong id="mrs_01_0368__en-us_topic_0000001173789254_b65502256448">i:address</strong></em>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname6550162511449">City A</span></i>'</p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li55505253444">Add users' educational backgrounds and titles to the <strong id="mrs_01_0368__en-us_topic_0000001173789254_b842165355719">user_info</strong> table.<p id="mrs_01_0368__en-us_topic_0000001173789254_p75501250441">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_0000001173789254_p1855010251442"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname4421346155314">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1155010256448">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1255022584410">12005000201</span></i>','<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname619450135315">i:degree</span></b>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname3550112564420">master</span></i>'</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p115501525164411"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname144835455311">put</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname6550132515448">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname355182511441">12005000201</span></i>','<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname19653135785315">i:pose</span></b>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1355112253446">manager</span></i>'</p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li1355172574413">Query user names and addresses by user ID.<p id="mrs_01_0368__en-us_topic_0000001173789254_p145511625174416"><a name="mrs_01_0368__en-us_topic_0000001173789254_li1355172574413"></a><a name="en-us_topic_0000001173789254_li1355172574413"></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_0000001173789254_p85511625124417"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname16258143195418">scan</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname6551825164419">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname1941275541">STARTROW</span></b>=&gt;'<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname1655132524416">12005000201</span></i>',<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname10328171115547">STOPROW</span></b>=&gt;'<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname755162514411">12005000201</span></i>',<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname13152515175420">COLUMNS</span></b>=&gt;['<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname879762415541">i:name</span></b>','<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname4362152819545">i:address</span></b>']}</p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li755110252441">Query information by user name.<p id="mrs_01_0368__en-us_topic_0000001173789254_p1855172511442"><a name="mrs_01_0368__en-us_topic_0000001173789254_li755110252441"></a><a name="en-us_topic_0000001173789254_li755110252441"></a>For example, to query information about user A, run the following command:</p>
<p id="mrs_01_0368__en-us_topic_0000001173789254_p755119258442"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname8844153216546">scan</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname13551102516445">user_info</span></i>',{<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname15734163611542">FILTER</span></b>=&gt;"SingleColumnValueFilter('i','name',=,'binary:<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname15551625144414">A</span></i>')"}</p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li145519255441">Delete user data from the user information table.<p id="mrs_01_0368__en-us_topic_0000001173789254_p7551132512449"><a name="mrs_01_0368__en-us_topic_0000001173789254_li145519255441"></a><a name="en-us_topic_0000001173789254_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__en-us_topic_0000001173789254_p755192517441"><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname61611240155412">delete</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname4551425114417">user_info</span></i>','<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname10551112512443">12005000201</span></i>','i'</p>
</li><li id="mrs_01_0368__en-us_topic_0000001173789254_li185511625134412">Delete the user information table.<p id="mrs_01_0368__en-us_topic_0000001173789254_p11551325174419"><a name="mrs_01_0368__en-us_topic_0000001173789254_li185511625134412"></a><a name="en-us_topic_0000001173789254_li185511625134412"></a><b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname58363438542">disable</span></b>'<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_varname16551142564417">user_info</span></i>';<b><span class="cmdname" id="mrs_01_0368__en-us_topic_0000001173789254_cmdname7221114875416">drop</span></b> '<i><span class="varname" id="mrs_01_0368__en-us_topic_0000001173789254_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>