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>
31 KiB
Using DBeaver to Access HetuEngine
This section uses DBeaver 6.3.5 as an example to describe how to perform operations on HetuEngine.
Prerequisites
- The DBeaver has been installed properly. Download the DBeaver software from https://dbeaver.io/files/6.3.5/.
- A human-machine user has been created in the cluster. For details about how to create a user, see Creating a HetuEngine User.
Procedure
Method 1: Using ZooKeeper to access HetuEngine
- Download the HetuEngine client.
- Log in to FusionInsight Manager.
- Choose Cluster > Services > HetuEngine > Dashboard.
- In the upper right corner of the page, choose More > Download Client and download the Complete Client to the local PC as prompted.
- 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.
- Download the Kerberos authentication file of the HetuEngine user.
- Log in to FusionInsight Manager.
- Choose System > Permission > User.
- Locate the row that contains the target HetuEngine user, click More in the Operation column, and select Download Authentication Credential.
- Decompress the downloaded package to obtain the user.keytab and krb5.conf files.
- Log in to the node where the HSBroker role is deployed in the cluster as user omm, go to the ${BIGDATA_HOME}/FusionInsight_Hetu_8.1.2.2/xxx_HSBroker/etc/ directory, and download the jaas-zk.conf and hetuserver.jks files to the local PC.
Modify the jaas-zk.conf file as follows. keyTab is the keytab file path of the user who accesses HetuEngine, and principal is Username for accessing HetuEngine@Domain name in uppercase.COM.
Client { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true keyTab="D:\\tmp\\user.keytab" principal="admintest@HADOOP.COM" useTicketCache=false storeKey=true debug=true; };
- Add the host mapping to the local hosts file. The content format is as follows:
Host IP address Host name
Example: 192.168.23.221 192-168-23-221
- Configure the DBeaver startup file dbeaver.ini.
- Add the Java path to the file.
-VM C:\Program Files\Java\jdk1.8.0_131\bin
- Set the ZooKeeper and Kerberos parameters by referring to the following parameters. Replace the file paths with the actual paths.
-Dsun.security.krb5.debug=true -Djava.security.auth.login.config=D:\tmp\jaas-zk.conf -Dzookeeper.sasl.clientconfig=Client -Dzookeeper.auth.type=kerberos -Djava.security.krb5.conf=D:\tmp\krb5.conf
- Add the Java path to the file.
- Start the DBeaver, right-click Database Navigator, and click Create New Connection.
- Search for Presto in the search box and double-click the Presto icon.
- Click Edit Driver Settings.
- Set Class Name to io.prestosql.jdbc.PrestoDriver.
- Enter the URL of HetuEngine in the URL Template text box.
URL format: jdbc:presto://IP address of node 1 where the ZooKeeper service resides:2181,IP address of node 2 where the ZooKeeper service resides:2181,IP address of node 3 where the ZooKeeper service resides:2181/hive/default?serviceDiscoveryMode=zooKeeper&zooKeeperNamespace=hsbroker&zooKeeperServerPrincipal=zookeeper/hadoop.hadoop.com
Example: jdbc:presto://192.168.8.37:2181,192.168.8.38:2181,192.168.8.39:2181/hive/default?serviceDiscoveryMode=zooKeeper&zooKeeperNamespace=hsbroker&zooKeeperServerPrincipal=zookeeper/hadoop.hadoop.com
- Click Add File and select the obtained JDBC file obtained in 1.d.
- Click Connection properties. On the Connection properties tab page, right-click and select Add new property. Set parameters by referring to Table 1.
Table 1 Property information Parameter
Example Value
KerberosPrincipal
zhangsan
NOTE:Human-machine user created in the cluster. For details, see Creating a HetuEngine User.
KerberosKeytabPath
D:\\user.keytab
NOTE:You need to configure this parameter when using the keytab mode for access.
KerberosRemoteServiceName
HTTP
SSL
true
deploymentMode
on_yarn
tenant
default
NOTE:The tenant to which the user belongs needs to be configured in the cluster.
user
zhangsan
NOTE:Human-machine user created in the cluster. For details, see Creating a HetuEngine User.
password
zhangsan@##65331853
NOTE:- Password set when a human-machine user is created in the cluster. For details, see Creating a HetuEngine User.
- You need to configure this parameter when using username and password for access.
KerberosConfigPath
D:\\krb5.conf
SSLTrustStorePath
D:\\hetuserver.jks
Figure 1 shows an example of the parameter settings.
- Click OK.
- Click Finish. The HetuEngine is successfully connected.
If a message is displayed indicating that you do not have the permission to view the table, configure the permission by referring to Configuring Permissions for Tables, Columns, and Databases.
Method 2: Using HSBroker to access HetuEngine
- Obtain the JDBC JAR file by referring to 1.
- Open DBeaver, choose Database > New Database Connection, search for PrestoSQL, and open it.
- Click Edit Driver Settings and set parameters by referring to the following table.
Table 2 Driver settings Parameter
Value
Remarks
Class Name
io.prestosql.jdbc.PrestoDriver
/
URL Template
URL of HetuEngine
URL format:
jdbc:presto://<HSBrokerIP1:port1>,<HSBrokerIP2:port2>,<HSBrokerIP3:port3>/hive/default?serviceDiscoveryMode=hsbroker
- Click Add File and upload the JDBC driver package obtained in 1.
- Click Find Class. The driver class is automatically obtained. Click OK to complete the driver setting, as shown in Figure 2.
- On the Main tab page for creating a connection, enter the user name and password, and click Test Connection. After the connection is successful, click OK, and then click Finish.
- After the connection is successful, the page shown in Figure 4 is displayed.