Updated on 2023-02-21 GMT+08:00

Using DBeaver to Access HetuEngine

Use DBeaver 7.2.0 as an example to describe how to access HetuEngine.

Prerequisites

Procedure

  1. Download the HetuEngine client to obtain the JDBC JAR package.

    1. Log in to FusionInsight Manager.
    2. Choose Cluster > Services > HetuEngine > Dashboard.
    3. In the upper right corner of the page, choose More > Download Client and download the Complete Client to the local PC as prompted.
    4. Decompress the HetuEngine client package FusionInsight_Cluster_Cluster ID_ HetuEngine_Client.tar to obtain the JDBC file and save it to a local directory, for example, D:\test.

      Obtaining the JDBC file:

      Decompress the package in the FusionInsight_Cluster_Cluster ID_HetuEngine_ClientConfig\HetuEngine\xxx\ directory to obtain the hetu-jdbc-*.jar file.

      Note: xxx can be arm or x86.

  2. Open DBeaver, choose Database > New Database Connection, search for PrestoSQL in ALL, and open PrestoSQL.
  3. Click Edit Driver Settings and set parameters by referring to the following table.

    Table 1 Driver settings

    Parameter

    Value

    Class Name

    io.prestosql.jdbc.PrestoDriver

    URL Template

    jdbc:presto://<HSBrokerIP1:port1>,<HSBrokerIP2:port2>,<HSBrokerIP3:port3>/catalog name/schema name?serviceDiscoveryMode=hsbroker&tenant=tenant name

    Example:

    jdbc:presto://192.168.8.37:29860,192.168.8.38:29860,192.168.8.39:29860/hive/default?serviceDiscoveryMode=hsbroker&tenant=default

    • To obtain the IP addresses and port numbers of the HSBroker nodes, perform the following operations:
      1. Log in to FusionInsight Manager.
      2. Choose Cluster > Services > HetuEngine. Click the Instance tab to obtain the service IP addresses of the HSBroker instances. You can select one or more normal instances for connection.
      3. To obtain the port numbers, choose Cluster > Services > HetuEngine. Click Configurations then All Configurations.

        Search for server.port to obtain the HSBroker port number. The default port number is 29860 in security mode and 29861 in normal mode.

    • If the connection fails, disable the proxy and try again.
    • The tenant parameter is optional. If this parameter is not set, a tenant is randomly matched.

  4. Click Add File and upload the JDBC driver package obtained in 1.
  5. Click Find Class. The driver class is automatically obtained. Click OK to complete the driver setting. If io.prestosql:presto-jdbc:RELEASE exists in Libraries, delete it before clicking Find Class.

    Figure 1 Configuring the driver in security mode

  6. Configure the connection.

    • Security mode (clusters with Kerberos authentication enabled):
      On the Main tab page for creating a connection, enter the user name and password created in Prerequisites, and click Test Connection. After the connection is successful, click OK then Finish. You can click Connection details (name, type, ... ) to change the connection name.
      Figure 2 Configuring parameters on the Main tab in security mode
    • Normal mode (clusters with Kerberos authentication disabled):

      On the page for creating a connection, configure the parameters on the Driver properties tab. Set user to the user created in Prerequisites. Click Test Connection. After the connection is successful, click OK then Finish. You can click Connection details (name, type, ... ) to change the connection name.

      Figure 3 Configuring parameters on the Driver properties tab in normal mode

  7. After the connection is successful, the page shown in Figure 4 is displayed.

    Figure 4 Successful connection