Updated on 2025-04-30 GMT+08:00

Using DBeaver to Access MRS HetuEngine

Application Scenarios

DBeaver is an SQL client and database management tool. For relational databases, you can use JDBC APIs to interact with a database through the JDBC driver. For NoSQL databases, you can use the dedicated database driver.

The following uses DBeaver 7.2.0 as an example to describe how to access HetuEngine.

Solution Architecture

Enterprises usually store massive data, such as from various databases and warehouses, for management and information collection. However, diversified data sources, hybrid dataset structures, and scattered data storage rise the development cost for cross-source query and prolong the cross-source query duration.

HetuEngine simplifies cross-source analysis operations by providing unified standard SQL statements for collaborative analysis.

Figure 1 DBeaver accessing MRS HetuEngine

Constraints

  • DBeaver 7.2.0 has been installed. Download the DBeaver software from https://dbeaver.io/files/7.2.0/.
  • This topic is available for MRS 3.1.2 and later clusters of the LTS version.

Step 1: Create an MRS Cluster and Compute Instances

  1. Create an MRS cluster.

    Create an MRS cluster that contains the HetuEngine component. For details, see Buying a Custom Cluster.

  2. Create the hetu_user user.

    Create a human-machine user, for example, hetu_user, in the cluster. For details, see Creating a HetuEngine User. For clusters with Ranger authentication enabled, you need to grant the Ranger permission to hetu_user based on service requirements. For details, see Adding a Ranger Access Permission Policy for HetuEngine.

  3. Creating a HetuEngine compute instance.

    Create a compute instance and ensure it is running properly. For details, see Creating a HetuEngine Compute Instance.

Step 2: Obtain the JDBC JAR Package and Configure Host Mapping

  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.

      How to obtain 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. Add the host mapping to the local hosts file.

    Add the mapping of the host where the instance is located in the HSFabric or HSBroker mode. The format is Host IP address Host name.

    Example: 192.168.42.90 server-2110081635-0001

    The local hosts file in a Windows environment is stored in, for example, C:\Windows\System32\drivers\etc.

Step 3: Configure DBeaver Parameters for Accessing HetuEngine

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

    In case that HSBroker cannot be used for accessing HetuEngine across network segments, use HSFabric for access instead.

    Table 1 Driver settings

    Parameter

    Value

    Class Name

    io.prestosql.jdbc.PrestoDriver

    URL Template

    • Access HetuEngine with HSFabric

      jdbc:presto://<HSFabricIP1:port1>,<HSFabricIP2:port2>,<HSFabricIP3:port3>/hive/default?serviceDiscoveryMode=hsfabric

      The following is an example:

      jdbc:presto://192.168.42.90:29902,192.168.42.91:29902,192.168.42.92:29902/hive/default?serviceDiscoveryMode=hsfabric

    • Access HetuEngine with HSBroker

      jdbc:presto://<HSBrokerIP1:port1>,<HSBrokerIP2:port2>,<HSBrokerIP3:port3>/hive/default?serviceDiscoveryMode=hsbroker

      The following is an example:

      jdbc:presto://192.168.42.90:29860,192.168.42.91:29860,192.168.42.92:29860/hive/default?serviceDiscoveryMode=hsbroker

    • To obtain the IP addresses and port numbers of the HSFabric and 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 all HSFabric or 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 gateway.port to obtain the HSFabric port number. The default port number is 29902 in security mode and 29903 in normal mode.

        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.
  3. Click Add File and upload the JDBC driver package obtained in Step 2: Obtain the JDBC JAR Package and Configure Host Mapping.
  4. 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 2 Configuring the driver in security mode
  5. Configure the connection.
    • Security mode (clusters with Kerberos authentication enabled):
      On the Main tab page for creating a connection, enter the username and password created in 2, 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 3 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 2. 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 4 Configuring parameters on the Driver properties tab in normal mode
  6. After the connection is successful, the page shown in the following figure is displayed.
    Figure 5 Successful connection