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

52 lines
23 KiB
HTML

<a name="mrs_01_0951"></a><a name="mrs_01_0951"></a>
<h1 class="topictitle1">Configuring Permissions to Use Other Components for Hive</h1>
<div id="body1590395281691"><div class="section" id="mrs_01_0951__sb8f4c139bb5f40c68d85bc5594749a47"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_0951__a97f0434b469b4d30884596195b4511c4">Hive may need to be associated with other components. For example, Yarn permissions are required in the scenario of using HQL statements to trigger MapReduce jobs, and HBase permissions are required in the Hive over HBase scenario. The following describes the operations in the two scenarios.</p>
<div class="note" id="mrs_01_0951__n7b1bbda6ae194f4d949ce016add26261"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0951__u603f9b42f8ce4b80b932cdd8dc62dc7f"><li id="mrs_01_0951__l0adccce02d4f42b4b73dc6d5c877b50f">In security mode, Yarn and HBase permission management is enabled by default. Therefore, Yarn and HBase permissions need to be configured by default.</li><li id="mrs_01_0951__l50475015677c473ca98131d27c3a25ef">In common mode, Yarn and HBase permission management is disabled by default. That is, any user has permissions. Therefore, YARN and HBase permissions does not need to be configured by default. If a user enables the permission management by modifying the Yarn or HBase configurations, the Yarn and HBase permissions then need to be configured.</li><li id="mrs_01_0951__li168631085544">MRS 3.<em id="mrs_01_0951__i256418119298">x</em> or later supports Ranger. If the current component uses Ranger for permission control, you need to configure permission management policies based on Ranger. For details, see <a href="mrs_01_1858.html">Adding a Ranger Access Permission Policy for Hive</a>.</li></ul>
</div></div>
</div>
<div class="section" id="mrs_01_0951__sc4a09fcb4e6d4665a2de9f35aee3bbf9"><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_0951__u5cd20879a1c64eefbbddbc64e2540182"><li id="mrs_01_0951__l856450cf9d7548008e31122aae84ffed">The Hive client has been installed. For example, the installation directory is <strong id="mrs_01_0951__b811915104418">/opt</strong><strong id="mrs_01_0951__b81191710642"></strong><strong id="mrs_01_0951__b1711914109419">/client</strong>.</li><li id="mrs_01_0951__le33111546d19468ba60c0ee10c24b614">You have obtained a user account with the <span id="mrs_01_0951__ph6527185844019">system </span>administrator permissions, such as <strong id="mrs_01_0951__b1993972213212">admin</strong>.</li></ul>
</div>
<div class="section" id="mrs_01_0951__s7ef4f16749134be1906d2c6e46c53499"><h4 class="sectiontitle">Procedure</h4><p id="mrs_01_0951__p55135322716"><strong id="mrs_01_0951__b5311851144518">Association with Yarn in MRS Earlier than 3.x</strong></p>
<p id="mrs_01_0951__abc12b4412d2e41038f79d0a87789d9f3">Yarn permissions are required when HQL statements, such as <strong id="mrs_01_0951__a56ea7c5c86fc42629d4dac8bb489e410">insert</strong>, <strong id="mrs_01_0951__ae9728c2d118f4bb9a093ca61ccc8c77d">count</strong>, <strong id="mrs_01_0951__aeededb7ae8a74cb39261d6004000de7a">distinct</strong>, <strong id="mrs_01_0951__a348b6c579d6745b3847130f01f5acfef">group by</strong>, <strong id="mrs_01_0951__a5d0cb9035dd04a208ddf9e3d3dc00ee3">order by</strong>, <strong id="mrs_01_0951__a6950ae8a6e674ebca7561f8af1d26cc8">sort by</strong>, and <strong id="mrs_01_0951__a130bf2cbdb4b4cec99a8036708e5720d">join</strong>, are used to trigger MapReduce jobs. The following uses the procedure for assigning a role the permissions to run the <strong id="mrs_01_0951__ab11e6a0a45314df28527c6b4c3d54b5c">count</strong> statements in the <strong id="mrs_01_0951__b069072922317">thc</strong> table as an example.</p>
<ol id="mrs_01_0951__o168e43d6f38a45aaab1a9282efd71db1"><li id="mrs_01_0951__l1482089303164006959fdc4997a28088"><span>Create a role on MRS Manager.</span></li><li id="mrs_01_0951__l7bc05d8308e54fbfb169de30526fa716"><span>In the <strong id="mrs_01_0951__b15968134532513">Permission</strong> table, choose <strong id="mrs_01_0951__b1570325913255">Yarn</strong> &gt; <strong id="mrs_01_0951__b822112416265">Scheduler Queue</strong> &gt; <strong id="mrs_01_0951__b13492167102611">root</strong>.</span></li><li id="mrs_01_0951__l4d1df6e1041541a798bf01d12300b8bf"><span>In the <strong id="mrs_01_0951__b12956164018254">Permission</strong> column of the default queue, select <strong id="mrs_01_0951__b1322801714263">Submit</strong> and click <strong id="mrs_01_0951__b152511420102620">OK</strong>.</span></li><li id="mrs_01_0951__l696d87ae0acf463fac396244f5f4717d"><span>In the <strong id="mrs_01_0951__b552182819269">Permission</strong> table, choose <strong id="mrs_01_0951__b493854311265">Hive</strong> &gt; <strong id="mrs_01_0951__b127531348182618">Hive Read Write Privileges</strong> &gt; <strong id="mrs_01_0951__b19872151122612">default</strong>, select <strong id="mrs_01_0951__b46031017271">Select</strong> for <strong id="mrs_01_0951__b178722452719">thc</strong>, and click <strong id="mrs_01_0951__b1667014762710">OK</strong>.</span></li></ol>
<p id="mrs_01_0951__p543152317528"><strong id="mrs_01_0951__b1043162314523">Association with</strong><strong id="mrs_01_0951__b194311523185210"> Yarn</strong><strong id="mrs_01_0951__b25411434495"> in MRS 3.<em id="mrs_01_0951__i18468144812465">x</em> or Later</strong></p>
<p id="mrs_01_0951__p9431112315214">Yarn permissions are required when HQL statements, such as <strong id="mrs_01_0951__b1987978922">insert</strong>, <strong id="mrs_01_0951__b522761946">count</strong>, <strong id="mrs_01_0951__b941231107">distinct</strong>, <strong id="mrs_01_0951__b611920">group by</strong>, <strong id="mrs_01_0951__b758653883">order by</strong>, <strong id="mrs_01_0951__b1154571062">sort by</strong>, and <strong id="mrs_01_0951__b1542350873">join</strong>, are used to trigger MapReduce jobs. The following uses the procedure for assigning a role the permissions to run the <strong id="mrs_01_0951__b2024105507">count</strong> statements in the <strong id="mrs_01_0951__b1624054701">thc</strong> table as an example.</p>
<ol id="mrs_01_0951__ol1343213232524"><li id="mrs_01_0951__li194321232525"><span>Create a role on FusionInsight Manager.</span></li><li id="mrs_01_0951__li843252310521"><span>In the <strong id="mrs_01_0951__b31165712552355">Configure Resource Permission</strong> table, choose <em id="mrs_01_0951__i27928647852355">Name of the desired cluster</em> &gt; <strong id="mrs_01_0951__b708428852355">Yarn</strong> &gt; <strong id="mrs_01_0951__b96635815252355">Scheduler Queue</strong> &gt; <strong id="mrs_01_0951__b93227410052355">root</strong>.</span></li><li id="mrs_01_0951__li94321323125215"><span>In the <strong id="mrs_01_0951__b197291086752355">Permission</strong> column of the <strong id="mrs_01_0951__b135759855752355">default </strong>queue, select <strong id="mrs_01_0951__b50017258252355">Submit</strong> and click <span class="uicontrol" id="mrs_01_0951__uicontrol172571673052355"><b>OK</b></span>.</span></li><li id="mrs_01_0951__li74321823145215"><span>In the <strong id="mrs_01_0951__b176072799652355">Configure Resource Permission</strong> table, choose <em id="mrs_01_0951__i2259635052355">Name of the desired cluster</em> &gt; <strong id="mrs_01_0951__b33582709152355">Hive </strong>&gt; <strong id="mrs_01_0951__b38632087452355">Hive Read Write Privileges</strong> &gt; <strong id="mrs_01_0951__b180498221352355">default</strong>. Select <strong id="mrs_01_0951__b74435774752355">SELECT</strong> for table <strong id="mrs_01_0951__b44326569952355">thc</strong>, and click <strong id="mrs_01_0951__b99008143752355">OK</strong>.</span></li></ol>
<p id="mrs_01_0951__p749713818712"><strong id="mrs_01_0951__b15509165504718">Hive over HBase Authorization in MRS Earlier than 3.x</strong></p>
<p id="mrs_01_0951__a79628b1b5f884ec99d2b2518eafb31e9">After the permissions are assigned, you can use HQL statements that are similar to SQL statements to access HBase tables from Hive. The following uses the procedure for assigning a user the rights to query HBase tables as an example.</p>
<ol id="mrs_01_0951__o0fe6d95738f9462b8122423d0815f083"><li id="mrs_01_0951__l5dcd76c4431243babfaf6cfed66ef47c"><span>On the role management page of MRS Manager, create an HBase role, for example, <strong id="mrs_01_0951__b17541549114">hive_hbase_create</strong>, and grant the permission to create HBase tables.</span><p><p id="mrs_01_0951__a05e5ac8ef9194eca883f5f0e4bfc1401">In the <strong id="mrs_01_0951__b356522114288">Permission</strong> table, choose <strong id="mrs_01_0951__b20235112522816">HBase</strong> &gt; <strong id="mrs_01_0951__b1353234102811">HBase Scope</strong> &gt; <strong id="mrs_01_0951__b1845263702810">global</strong>, select <strong id="mrs_01_0951__b8703164312283">create</strong> of the namespace <strong id="mrs_01_0951__b970094912815">default</strong>, and click <strong id="mrs_01_0951__b5695622810">OK</strong>.</p>
</p></li><li id="mrs_01_0951__l1f8708bf45424de8aee48f595ee0453d"><span>On MRS Manager, create a human-machine user, for example, <strong id="mrs_01_0951__b166527545113">hbase_creates_user</strong>, add the user to the <strong id="mrs_01_0951__b1365855415115">hive</strong> group, and bind the <strong id="mrs_01_0951__b2065915543116">hive_hbase_create</strong> role to the user so that the user can create Hive and HBase tables.</span></li><li id="mrs_01_0951__le5c89eaab339455cbfafc7dfefe99b7e"><span><span id="mrs_01_0951__ph1824832115713">Log in to the node where the client is installed. For details, see <a href="https://docs.otc.t-systems.com/usermanual/mrs/mrs_01_0091.html" target="_blank" rel="noopener noreferrer">Installing a Client</a>.</span></span></li><li id="mrs_01_0951__l0f3a0529df284c05950bed4fcf7ece1b"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_0951__ac254199782ff42d5803b4235bd66d49f"><strong id="mrs_01_0951__ac649466204fe4a25a0571bc91bba4fa5">source /opt/client/bigdata_env</strong></p>
</p></li><li id="mrs_01_0951__l9b6ad09bfa89459cb9c3e02bfe4d50ff"><span>Run the following command to authenticate the user:</span><p><p class="litext" id="mrs_01_0951__aeb6be69711f3469f95294f9d284a7637"><strong id="mrs_01_0951__a5360d2d7a8af46a6b6ea2962565ea949">kinit hbase_creates_user</strong></p>
</p></li><li id="mrs_01_0951__l60c6415ee6f349ab85fa816f0645100e"><span>Run the following command to go to the shell environment of the Hive client:</span><p><p class="litext" id="mrs_01_0951__afbecb80aa4c54b1494c55ad9400dd684"><strong id="mrs_01_0951__a2bc438652a5a42c5a898165c802198da">beeline</strong></p>
</p></li><li id="mrs_01_0951__l7f58131545b64e078dcae8477e34ca26"><span>Run the following command to create a table in Hive and HBase, for example, the <strong id="mrs_01_0951__b19347155419306">thh</strong> table.</span><p><p id="mrs_01_0951__ab576f56741474d77876b5126173d5a1f"><strong id="mrs_01_0951__aab970834fc0d4ed19d8f5d7127fa35ad">CREATE TABLE thh(id int, name string, country string) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES("hbase.columns.mapping" = "cf1:id,cf1:name,:key") TBLPROPERTIES ("hbase.table.name" = "thh");</strong></p>
<p id="mrs_01_0951__a7a9ea5d3f8d942a9a09d6100dde2c50d">The created Hive table and the HBase table are stored in the Hive database <strong id="mrs_01_0951__b676133433218">default</strong> and the HBase namespace <strong id="mrs_01_0951__b35161643103212">default</strong>, respectively.</p>
</p></li><li id="mrs_01_0951__lfe447181706a4eb7a112fd38f8d7235a"><span>On the role management page of MRS Manager, create a role, for example, <strong id="mrs_01_0951__b2381185812116">hive_hbase_select</strong>, and assign the role the permission to query the Hive table <strong id="mrs_01_0951__b338215813118">thh</strong> and the HBase table <strong id="mrs_01_0951__b193831358313">thh</strong>.</span><p><ol type="a" id="mrs_01_0951__o2f2af2b282974f5a9369bfb1a24cd7ff"><li id="mrs_01_0951__leeaae33901c74dc9b3e2db9f75964045">In the <strong id="mrs_01_0951__b1982179173510">Permission</strong> table, choose <strong id="mrs_01_0951__b739643203515">HBase</strong> &gt; <strong id="mrs_01_0951__b15099125362">HBase Scope</strong> &gt; <strong id="mrs_01_0951__b102191515133617">global</strong> &gt; <strong id="mrs_01_0951__b14648619203620">default</strong>, select <strong id="mrs_01_0951__b1861215241366">Read</strong> for the <strong id="mrs_01_0951__b9122132911368">thh</strong> table, and click <strong id="mrs_01_0951__b76781932103611">OK</strong> to grant the HBase role the permission to query the table.</li><li id="mrs_01_0951__ld5ef39342db04984817692213b53f93a">Edit a role. In the <strong id="mrs_01_0951__b842352706163024">Permission</strong> table, choose <strong id="mrs_01_0951__b842352706163027">HBase</strong> &gt; <strong id="mrs_01_0951__b842352706163031">HBase Scope</strong> &gt; <strong id="mrs_01_0951__b842352706163036">global</strong> &gt; <strong id="mrs_01_0951__b842352706163040">hbase</strong>. Select <strong id="mrs_01_0951__b84235270616311">Execute</strong> for <strong id="mrs_01_0951__b84235270616317">hbase:meta</strong>, and click <strong id="mrs_01_0951__b842352706163112">OK</strong>.</li><li id="mrs_01_0951__l944e235303d845bd98d6a10bf774d221">Edit a role. In the <strong id="mrs_01_0951__b1493616143119">Permission</strong> table, choose <strong id="mrs_01_0951__b2098516153113">Hive</strong> &gt; <strong id="mrs_01_0951__b1499416113113">Hive Read Write Privileges</strong> &gt; <strong id="mrs_01_0951__b12990169319">default</strong>, select <strong id="mrs_01_0951__b19100616103112">Select</strong> for <strong id="mrs_01_0951__b1410011162311">thh</strong>, and click <strong id="mrs_01_0951__b18100171633120">OK</strong>.</li></ol>
</p></li><li id="mrs_01_0951__l9a651e1093c14468825765316b1b1eff"><span>On MRS Manager, create a human-machine user, for example, <strong id="mrs_01_0951__b66601238214">hbase_select_user</strong>, add the user to the <strong id="mrs_01_0951__b16611136217">hive</strong> group, and bind the <strong id="mrs_01_0951__b966363322">hive_hbase_select</strong> role to the user so that the user can query Hive and HBase tables.</span></li><li id="mrs_01_0951__l4a0a499259704fbe85c8f270e470d896"><span>Run the following command to configure environment variables:</span><p><p class="litext" id="mrs_01_0951__a14958cadc646462ba548eafe33dde6a4"><strong id="mrs_01_0951__aaafa965a8c1140e9910dc32747388c94">source /opt/client/bigdata_env</strong></p>
</p></li><li id="mrs_01_0951__l2757c0cb0d4f4022bcaefe746d6c77af"><span>Run the following command to authenticate users:</span><p><p class="litext" id="mrs_01_0951__ac049e16ea1a745bb93722d79746bb5cc"><strong id="mrs_01_0951__a0f6184584375469ca1e34df29a80699d">kinit hbase_select_user</strong></p>
</p></li><li id="mrs_01_0951__lf985d90033f2437f9d2693ce2eef1690"><span>Run the following command to go to the shell environment of the Hive client:</span><p><p class="litext" id="mrs_01_0951__ad554984bd6ed401095b62b3c3672cdc1"><strong id="mrs_01_0951__a2cc60a2f7d4a4d3988690de05194f13f">beeline</strong></p>
</p></li><li id="mrs_01_0951__ldc07c3d7aca54a458e91557fb183a7d0"><span>Run the following command to use an HQL statement to query HBase table data:</span><p><p id="mrs_01_0951__a233d4f66ebc540b984e6160d5ace176e"><strong id="mrs_01_0951__ac15650d5076b46368dcd16df4897acc3">select * from thh;</strong></p>
</p></li></ol>
<p id="mrs_01_0951__p1765364755220"><strong id="mrs_01_0951__b16653184735216">Hive over HBase Authorization in MRS 3.<em id="mrs_01_0951__i3718184818512">x</em> or Later</strong></p>
<p id="mrs_01_0951__p5653124715220">After the permissions are assigned, you can use HQL statements that are similar to SQL statements to access HBase tables from Hive. The following uses the procedure for assigning a user the rights to query HBase tables as an example.</p>
<ol id="mrs_01_0951__ol1653164795211"><li id="mrs_01_0951__li2065312471528"><span>On the role management page of FusionInsight Manager, create an HBase role, for example, <strong id="mrs_01_0951__b171746079352355">hive_hbase_create</strong>, and grant the permission to create HBase tables.</span><p><p id="mrs_01_0951__p565374715523">In the <strong id="mrs_01_0951__b156178898352355">Configure Resource Permission</strong> table, choose <em id="mrs_01_0951__i137552329052355">Name of the desired cluster</em> &gt; <strong id="mrs_01_0951__b26890229652355">HBase </strong>&gt; <strong id="mrs_01_0951__b96530061652355">HBase Scope</strong> &gt; <strong id="mrs_01_0951__b155890334852355">global</strong>. Select <strong id="mrs_01_0951__b179827979452355">Create</strong> of the namespace <strong id="mrs_01_0951__b113224788852355">default</strong>, and click <strong id="mrs_01_0951__b81439735052355">OK</strong>.</p>
</p></li><li id="mrs_01_0951__li10653184712528"><span>On FusionInsight Manager, create a human-machine user, for example, <strong id="mrs_01_0951__b92034485952355">hbase_creates_user</strong>, add the user to the <strong id="mrs_01_0951__b43602423852355">hive</strong> group, and bind the <strong id="mrs_01_0951__b146931292352355">hive_hbase_create</strong> role to the user so that the user can create Hive and HBase tables.</span></li><li id="mrs_01_0951__li11854133324411"><span>If the current component uses Ranger for permission control, grant the create permission for <strong id="mrs_01_0951__b1021041216613">hive_hbase_create</strong> or <strong id="mrs_01_0951__b1733319161164">hbase_creates_user</strong>. For details, see <a href="mrs_01_1858.html">Adding a Ranger Access Permission Policy for Hive</a>.</span></li><li id="mrs_01_0951__li26537475528"><span>Log in to the node where the client is installed as the client installation user.</span></li><li id="mrs_01_0951__li0653184714525"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_0951__p1065313472523"><strong id="mrs_01_0951__b16653144795216">source /opt/client/bigdata_env</strong></p>
</p></li><li id="mrs_01_0951__li12653847135220"><span>Run the following command to authenticate the user:</span><p><p class="litext" id="mrs_01_0951__p6653114716528"><strong id="mrs_01_0951__b165394785220">kinit hbase_creates_user</strong></p>
</p></li><li id="mrs_01_0951__li136535471525"><span>Run the following command to go to the shell environment of the Hive client:</span><p><p class="litext" id="mrs_01_0951__p96531247185217"><strong id="mrs_01_0951__b1165314785218">beeline</strong></p>
</p></li><li id="mrs_01_0951__li46530476525"><span>Run the following command to create a table in Hive and HBase, for example, the <strong id="mrs_01_0951__b853916171">thh</strong> table.</span><p><p id="mrs_01_0951__p065314718529"><strong id="mrs_01_0951__b2653134785215">CREATE TABLE thh(id int, name string, country string) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES("hbase.columns.mapping" = "cf1:id,cf1:name,:key") TBLPROPERTIES ("hbase.table.name" = "thh");</strong></p>
<p id="mrs_01_0951__p2653247135211">The created Hive table and the HBase table are stored in the Hive database <strong id="mrs_01_0951__b1160285491">default</strong> and the HBase namespace <strong id="mrs_01_0951__b401260466">default</strong>, respectively.</p>
</p></li><li id="mrs_01_0951__li16531347135217"><span>On the role management page of FusionInsight Manager, create a role, for example, <strong id="mrs_01_0951__b132799868852355">hive_hbase_select</strong>, and assign the role the permission to query the Hive table <strong id="mrs_01_0951__b104705532852355">thh</strong> and the HBase table <strong id="mrs_01_0951__b206263925152355">thh</strong>.</span><p><ol type="a" id="mrs_01_0951__ol17653747125216"><li id="mrs_01_0951__li8653134755213">In the <strong id="mrs_01_0951__b89218577529">Configure Resource Permission</strong> table, choose <em id="mrs_01_0951__i149355712529">Name of the desired cluster</em> &gt; <strong id="mrs_01_0951__b10936578523">HBase </strong>&gt; <strong id="mrs_01_0951__b79485745218">HBase Scope</strong> &gt; <strong id="mrs_01_0951__b1994185775210">global </strong>&gt; <strong id="mrs_01_0951__b795155715220">default</strong>. Select <strong id="mrs_01_0951__b89512572524">read </strong>of the <strong id="mrs_01_0951__b10961357195210">thh</strong> table, and click <span class="uicontrol" id="mrs_01_0951__uicontrol1963571526"><b>OK</b></span> to grant the table query permission to the HBase role.</li><li id="mrs_01_0951__li11653164745211">Edit the role. In the <strong id="mrs_01_0951__b2316053552355">Configure Resource Permission</strong> table, choose <em id="mrs_01_0951__i5495174952355">Name of the desired cluster</em> &gt; <strong id="mrs_01_0951__b22575308352355">HBase </strong>&gt; <strong id="mrs_01_0951__b181781665852355">HBase Scope</strong> &gt; <strong id="mrs_01_0951__b171154913652355">global </strong>&gt; <strong id="mrs_01_0951__b144341734652355">hbase</strong>, select <strong id="mrs_01_0951__b212097109552355">Execute</strong> for <strong id="mrs_01_0951__b160860824652355">hbase:meta</strong>, and click <span class="uicontrol" id="mrs_01_0951__uicontrol16653204785210"><b>OK</b></span>.</li><li id="mrs_01_0951__li865444713522">Edit the role. In the <strong id="mrs_01_0951__b118060702052355">Configure Resource Permission</strong> table, choose <em id="mrs_01_0951__i135917061852355">Name of the desired cluster</em> &gt; <strong id="mrs_01_0951__b205009759152355">Hive </strong>&gt; <strong id="mrs_01_0951__b77335987652355">Hive Read Write Privileges</strong> &gt; <strong id="mrs_01_0951__b50148176952355">default</strong>. Select <strong id="mrs_01_0951__b145633592352355">SELECT</strong> for the <strong id="mrs_01_0951__b101662333252355">thh </strong>table, and click <strong id="mrs_01_0951__b144510946652355">OK</strong>.</li></ol>
</p></li><li id="mrs_01_0951__li46541747205214"><span>On FusionInsight Manager, create a human-machine user, for example, <strong id="mrs_01_0951__b16335123452355">hbase_select_user</strong>, add the user to the <strong id="mrs_01_0951__b140081899252355">hive</strong> group, and bind the <strong id="mrs_01_0951__b205005410252355">hive_hbase_select</strong> role to the user so that the user can query Hive and HBase tables.</span></li><li id="mrs_01_0951__li4654174713527"><span>Run the following command to configure environment variables:</span><p><p class="litext" id="mrs_01_0951__p146541247125213"><strong id="mrs_01_0951__b1654204718521">source /opt/client/bigdata_env</strong></p>
</p></li><li id="mrs_01_0951__li7654747195210"><span>Run the following command to authenticate users:</span><p><p class="litext" id="mrs_01_0951__p15654114710521"><strong id="mrs_01_0951__b56547473528">kinit hbase_select_user</strong></p>
</p></li><li id="mrs_01_0951__li1665444775211"><span>Run the following command to go to the shell environment of the Hive client:</span><p><p class="litext" id="mrs_01_0951__p1565414714521"><strong id="mrs_01_0951__b1165454719524">beeline</strong></p>
</p></li><li id="mrs_01_0951__li11654124745217"><span>Run the following command to use an HQL statement to query HBase table data:</span><p><p id="mrs_01_0951__p5654647105211"><strong id="mrs_01_0951__b1865484785214">select * from thh;</strong></p>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0947.html">Permission Management</a></div>
</div>
</div>