Yang, Tong 48706b7552 MRS COMP-LTS 320-lts.1 version
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2024-04-12 12:51:10 +00:00

65 lines
14 KiB
HTML

<a name="mrs_01_2337"></a><a name="mrs_01_2337"></a>
<h1 class="topictitle1">Using DBeaver to Access HetuEngine</h1>
<div id="body32001227"><p id="mrs_01_2337__p39971623131118">Use DBeaver 7.2.0 as an example to describe how to access <span id="mrs_01_2337__text2361165118404">HetuEngine</span>.</p>
<div class="section" id="mrs_01_2337__section10331142641215"><a name="mrs_01_2337__section10331142641215"></a><a name="section10331142641215"></a><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_2337__ul3839938134"><li id="mrs_01_2337__li78391531138">The DBeaver has been installed properly. Download the DBeaver software from <a href="https://dbeaver.io/files/7.2.0/" target="_blank" rel="noopener noreferrer">https://dbeaver.io/files/7.2.0/</a>.</li><li id="mrs_01_2337__li527205219137">A human-machine user, for example, <strong id="mrs_01_2337__b1236752616206">hetu_user</strong>, has been created in the cluster. For details, see <a href="mrs_01_1714.html">Creating a HetuEngine User</a>. For clusters with Ranger authentication enabled, the Ranger permission must be added to user <strong id="mrs_01_2337__b193312380209">hetu_user</strong> based on service requirements. For details, see <a href="mrs_01_1862.html">Adding a Ranger Access Permission Policy for HetuEngine</a>.</li><li id="mrs_01_2337__li46951558193917">A compute instance has been created and is running properly. For details, see <a href="mrs_01_1731.html">Creating HetuEngine Compute Instances</a>.</li></ul>
</div>
<div class="section" id="mrs_01_2337__section73416378360"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_2337__ol6951355135810"><li id="mrs_01_2337__li599475416716"><a name="mrs_01_2337__li599475416716"></a><a name="li599475416716"></a><span>Download the <span id="mrs_01_2337__text1399510541779">HetuEngine</span> client to obtain the JDBC JAR package.</span><p><ol type="a" id="mrs_01_2337__ol4995154872"><li id="mrs_01_2337__li119956541172">Log in to FusionInsight Manager.</li><li id="mrs_01_2337__li13995205419710">Choose <strong id="mrs_01_2337__b33591652165213">Cluster</strong> &gt; <strong id="mrs_01_2337__b24451954155214">Services</strong> &gt; <strong id="mrs_01_2337__b192118241544"><span id="mrs_01_2337__text1678211217589">HetuEngine</span></strong> &gt; <strong id="mrs_01_2337__b583113531">Dashboard</strong>.</li><li id="mrs_01_2337__li19995195420715">In the upper right corner of the page, choose <strong id="mrs_01_2337__b5264176537">More</strong> &gt; <strong id="mrs_01_2337__b1990151917538">Download Client</strong> and download the <span class="parmvalue" id="mrs_01_2337__parmvalue1692918355398"><b>Complete Client</b></span> to the local PC as prompted.</li><li id="mrs_01_2337__li8995125413711">Decompress the <span id="mrs_01_2337__text33661017164113">HetuEngine</span> client package <strong id="mrs_01_2337__b2096124844019">FusionInsight_Cluster_</strong><em id="mrs_01_2337__i983133743915">Cluster ID</em><strong id="mrs_01_2337__b1997148124018">_ <span id="mrs_01_2337__text11315321741">HetuEngine</span>_Client.tar</strong> to obtain the JDBC file and save it to a local directory, for example, <strong id="mrs_01_2337__b111037598416">D:\test</strong>.<div class="note" id="mrs_01_2337__note1996195416717"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_2337__p10996954179">Obtaining the JDBC file:</p>
<p id="mrs_01_2337__p129965541075">Decompress the package in the <strong id="mrs_01_2337__b17426132971715">FusionInsight_Cluster_</strong><em id="mrs_01_2337__i81190366171">Cluster ID</em><strong id="mrs_01_2337__b2363711141814">_<span id="mrs_01_2337__text19961354675">HetuEngine</span>_ClientConfig\<span id="mrs_01_2337__text29965541873">HetuEngine</span>\xxx\</strong> directory to obtain the <strong id="mrs_01_2337__b1612183315185">hetu-jdbc-*.jar</strong> file.</p>
<p id="mrs_01_2337__p09965541276">Note: <strong id="mrs_01_2337__b19550102810296">xxx</strong> can be <strong id="mrs_01_2337__b14551102813293">arm</strong> or <strong id="mrs_01_2337__b955112832916">x86</strong>.</p>
</div></div>
</li></ol>
</p></li><li id="mrs_01_2337__li12936434124214"><span>Add the host mapping to the local <strong id="mrs_01_2337__b473622211256">hosts</strong> file.</span><p><p id="mrs_01_2337__p176961935164213">Add the mapping of the host where the instance is located in the HSFabric or HSBroker mode. The format is <em id="mrs_01_2337__i95091444296">Host IP address</em> <em id="mrs_01_2337__i15146104813297">Host name</em>.</p>
<p id="mrs_01_2337__p19269047185012">Example: <strong id="mrs_01_2337__b465116439258">192.168.42.90 server-2110081635-0001</strong></p>
<div class="note" id="mrs_01_2337__note496015462138"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_2337__p02872931510">The local <strong id="mrs_01_2337__b31876222625144">hosts</strong> file in a Windows environment is stored in, for example, <strong id="mrs_01_2337__b198273578225144">C:\Windows\System32\drivers\etc</strong>.</p>
</div></div>
</p></li><li id="mrs_01_2337__li99517556587"><span>Open DBeaver, choose <strong id="mrs_01_2337__b197561840142917">Database</strong> &gt; <strong id="mrs_01_2337__b7756174012912">New Database Connection</strong>, search for <strong id="mrs_01_2337__b67801857171813">PrestoSQL</strong> in <strong id="mrs_01_2337__b1990619411195">ALL</strong>, and open PrestoSQL.</span></li><li id="mrs_01_2337__li295135525812"><span>Click <strong id="mrs_01_2337__b104691094116">Edit Driver Settings</strong> and set parameters by referring to the following table.</span><p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_2337__table1951558586" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Driver settings</caption><thead align="left"><tr id="mrs_01_2337__row179511554588"><th align="left" class="cellrowborder" valign="top" width="11.540000000000001%" id="mcps1.3.3.2.4.2.1.2.3.1.1"><p id="mrs_01_2337__p6951455155818">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="88.46000000000001%" id="mcps1.3.3.2.4.2.1.2.3.1.2"><p id="mrs_01_2337__p179675517589">Value</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_2337__row159675513585"><td class="cellrowborder" valign="top" width="11.540000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="mrs_01_2337__p996135514580">Class Name</p>
</td>
<td class="cellrowborder" valign="top" width="88.46000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="mrs_01_2337__p189620558589">io.prestosql.jdbc.PrestoDriver</p>
</td>
</tr>
<tr id="mrs_01_2337__row99695520584"><td class="cellrowborder" valign="top" width="11.540000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="mrs_01_2337__p99635555815">URL Template</p>
</td>
<td class="cellrowborder" valign="top" width="88.46000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><ul id="mrs_01_2337__ul13319529182"><li id="mrs_01_2337__li1092923531817">Accessing <span id="mrs_01_2337__text892719523189">HetuEngine</span> using HSFabric<p id="mrs_01_2337__p17302113819181">jdbc:presto://&lt;<em id="mrs_01_2337__i6439415481">HSFabricIP1:port1</em>&gt;,&lt;<em id="mrs_01_2337__i6439141144819">HSFabricIP2:port2</em>&gt;,&lt;<em id="mrs_01_2337__i184391174815">HSFabricIP3:port3</em>&gt;/hive/default?serviceDiscoveryMode=hsfabric</p>
<p id="mrs_01_2337__p6801175228">Example:</p>
<p id="mrs_01_2337__p198011722214">jdbc:presto://192.168.42.90:29902,192.168.42.91:29902,192.168.42.92:29902/hive/default?serviceDiscoveryMode=hsfabric</p>
</li><li id="mrs_01_2337__li10891145101813">Accessing <span id="mrs_01_2337__text113766616191">HetuEngine</span> using HSBroker<p id="mrs_01_2337__p9341919201813">jdbc:presto://&lt;<em id="mrs_01_2337__i123411921813">HSBrokerIP1:port1</em>&gt;,&lt;<em id="mrs_01_2337__i1334161918185">HSBrokerIP2:port2</em>&gt;,&lt;<em id="mrs_01_2337__i153461941818">HSBrokerIP3:port3</em>&gt;/hive/default?serviceDiscoveryMode=hsbroker</p>
<p id="mrs_01_2337__p1645171832219">Example:</p>
<p id="mrs_01_2337__p4645111812222">jdbc:presto://192.168.42.90:29860,192.168.42.91:29860,192.168.42.92:29860/hive/default?serviceDiscoveryMode=hsbroker</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="mrs_01_2337__note116861826121513"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_2337__ul268642661517"><li id="mrs_01_2337__li11686142641519">To obtain the IP addresses and port numbers of the HSFabric and HSBroker nodes, perform the following operations:<ol type="a" id="mrs_01_2337__ol117411151111512"><li id="mrs_01_2337__li574185111152">Log in to FusionInsight Manager.</li><li id="mrs_01_2337__li11276726153315">Choose <strong id="mrs_01_2337__b828716819218">Cluster</strong> &gt; <strong id="mrs_01_2337__b5836161213213">Services</strong> &gt; <strong id="mrs_01_2337__b484812215212"><span id="mrs_01_2337__text3686142617158">HetuEngine</span></strong>. Click the <strong id="mrs_01_2337__b850883592120">Instance</strong> tab to obtain the service IP addresses of all HSFabric or HSBroker instances. You can select one or more normal instances for connection.</li><li id="mrs_01_2337__li176751814114010">To obtain the port numbers, choose <strong id="mrs_01_2337__b166901629182318">Cluster</strong> &gt; <strong id="mrs_01_2337__b17564311230">Services</strong> &gt; <strong id="mrs_01_2337__b12341648172320"><span id="mrs_01_2337__text8834164501710">HetuEngine</span></strong>. Click <strong id="mrs_01_2337__b1042045915233">Configurations</strong> then <strong id="mrs_01_2337__b3356140192417">All Configurations</strong>.<p id="mrs_01_2337__p138514571177">Search for <strong id="mrs_01_2337__b777161862615">gateway.port</strong> to obtain the HSFabric port number. The default port number is <strong id="mrs_01_2337__b98424463285">29902</strong> in security mode and <strong id="mrs_01_2337__b1744411544283">29903</strong> in normal mode.</p>
<p id="mrs_01_2337__p229011517415">Search for <strong id="mrs_01_2337__b3482713192919">server.port</strong> to obtain the HSBroker port number. The default port number is <strong id="mrs_01_2337__b463622032918">29860</strong> in security mode and <strong id="mrs_01_2337__b10577152614297">29861</strong> in normal mode.</p>
</li></ol>
</li></ul>
<ul id="mrs_01_2337__ul18686226191515"><li id="mrs_01_2337__li17686102681516">If the connection fails, disable the proxy and try again.</li></ul>
</div></div>
</p></li><li id="mrs_01_2337__li189611553589"><span>Click <strong id="mrs_01_2337__b17589051122913">Add File</strong> and upload the JDBC driver package obtained in <a href="#mrs_01_2337__li599475416716">1</a>.</span></li><li id="mrs_01_2337__li864414489817"><span>Click <strong id="mrs_01_2337__b2314171020308">Find Class</strong>. The driver class is automatically obtained. Click <strong id="mrs_01_2337__b173276105306">OK</strong> to complete the driver setting. If <strong id="mrs_01_2337__b513151103112">io.prestosql:presto-jdbc:RELEASE</strong> exists in <strong id="mrs_01_2337__b13989844319">Libraries</strong>, delete it before clicking <strong id="mrs_01_2337__b48753673118">Find Class</strong>.</span><p><div class="fignone" id="mrs_01_2337__fig896115518584"><span class="figcap"><b>Figure 1 </b>Configuring the driver in security mode</span><br><span><img id="mrs_01_2337__image107937586555" src="en-us_image_0000001584317997.png"></span></div>
</p></li><li id="mrs_01_2337__li114444254598"><span>Configure the connection.</span><p><ul id="mrs_01_2337__ul1394181915414"><li id="mrs_01_2337__li2709141017242">Security mode (clusters with Kerberos authentication enabled):<div class="p" id="mrs_01_2337__p1732111162415"><a name="mrs_01_2337__li2709141017242"></a><a name="li2709141017242"></a>On the <strong id="mrs_01_2337__b103300032385413">Main</strong> tab page for creating a connection, enter the user name and password created in <a href="#mrs_01_2337__section10331142641215">Prerequisites</a>, and click <strong id="mrs_01_2337__b17549201285413">Test Connection</strong>. After the connection is successful, click <strong id="mrs_01_2337__b180287667785413">OK</strong> then <strong id="mrs_01_2337__b159216249185413">Finish</strong>. You can click <strong id="mrs_01_2337__b187621313173512">Connection details (name, type, ... )</strong> to change the connection name.<div class="fignone" id="mrs_01_2337__fig159695519589"><span class="figcap"><b>Figure 2 </b>Configuring parameters on the Main tab in security mode</span><br><span><img id="mrs_01_2337__image18407828193214" src="en-us_image_0000001533678044.png"></span></div>
</div>
</li><li id="mrs_01_2337__li37221914192413">Normal mode (clusters with Kerberos authentication disabled):<p id="mrs_01_2337__p117038013915"><a name="mrs_01_2337__li37221914192413"></a><a name="li37221914192413"></a>On the <strong id="mrs_01_2337__b225917304105">Main</strong> tab page for creating a connection, set JDBC URL and leave Password blank.</p>
<p id="mrs_01_2337__p93281815202415">On the page for creating a connection, configure the parameters on the <strong id="mrs_01_2337__b1255018357378">Driver properties</strong> tab. Set <strong id="mrs_01_2337__b17366641194116">user</strong> to the user created in <a href="#mrs_01_2337__section10331142641215">Prerequisites</a>. Click <strong id="mrs_01_2337__b2509155934110">Test Connection</strong>. After the connection is successful, click <strong id="mrs_01_2337__b172092014428">OK</strong> then <strong id="mrs_01_2337__b6641534144213">Finish</strong>. You can click <strong id="mrs_01_2337__b958032213435">Connection details (name, type, ... )</strong> to change the connection name.</p>
<div class="fignone" id="mrs_01_2337__fig1995665612304"><span class="figcap"><b>Figure 3 </b>Configuring parameters on the Driver properties tab in normal mode</span><br><span><img id="mrs_01_2337__image146053814302" src="en-us_image_0000001533198872.png"></span></div>
</li></ul>
</p></li><li id="mrs_01_2337__li79645515815"><span>After the connection is successful, the page shown in <a href="#mrs_01_2337__fig296125555813">Figure 4</a> is displayed.</span><p><div class="fignone" id="mrs_01_2337__fig296125555813"><a name="mrs_01_2337__fig296125555813"></a><a name="fig296125555813"></a><span class="figcap"><b>Figure 4 </b>Successful connection</span><br><span><img id="mrs_01_2337__image690933613267" src="en-us_image_0000001533358396.png"></span></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_2336.html">Using a Third-Party Visualization Tool to Access HetuEngine</a></div>
</div>
</div>