Commissioning Applications on Linux
Scenario
After the code is developed, you can compile the code into a JAR file and upload it to a Linux environment for application function commissioning.
Before commissioning applications on Linux, you need to pre-install a client on the Linux node.
Procedure
- Change the path for storing the KeyTab file in the jaas-zk.conf file in the Linux environment as required. for example, /opt/client/conf/user.keytab.
- Modify the configuration file path of the sample code, as shown in the following example:
private final static String PATH_TO_KRB5_CONF = "/opt/client/krb5.conf"
- In the Windows development environment IntelliJ IDEA, choose Maven Projects > Example project name > Lifecycle and perform the clean and package operations. After the compilation is complete, the hetu-examples-XXX.jar file is generated in the target directory.
- Upload the hetu-examples-XXX.jar file to the /opt/client directory in the Linux environment.
- Download and decompress the client file FusionInsight_Cluster_Cluster ID_HetuEngine_Client.tar by referring to Preparing Development Environment, obtain the JDBC drive package, and upload it to the /opt//client directory in the Linux environment.
The JDBC driver package hetu-jdbc-*.jar can be obtained from the FusionInsight_Cluster_1_Services_ClientConfig\HetuEngine\XXX\ directory where the cluster client software package is decompressed. In the directory, XXX indicates ARM or x86.
- Upload the jaas-zk.conf, user.keytab, and krb5.conf files obtained in Preparing for Security Authentication to the /opt/client directory in the Linux environment.
- Run the following command to go to the client installation directory:
cd /opt/client
- Run the following command to configure environment variables:
source bigdata_env
- Run the following command to debug the development program:
java -classpath hetu-examples-*.jar:hetu-jdbc-*.jar com.huawei.hetu.className
- Replace the JDBC driver package name and class name with the actual ones, for example, java -classpath hetu-examples-*.jar:hetu-jdbc-*.jar com.huawei.hetu.JDBCExampleBroker.
- If SSL authentication of ZooKeeper is enabled for the interconnected cluster, you need to add the following JVM configuration
-Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty -Dzookeeper.client.secure=true.
Using JDBCExampleZK as an example, the corresponding debugging command is as follows: java -cp hetu-examples-*.jar:hetu-jdbc-*.jar -Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty -Dzookeeper.client.secure=true com.huawei.hetu.JDBCExampleZK.
- Check whether the command output is normal.
Jul 01, 2021 8:41:23 PM io.prestosql.jdbc.$internal.airlift.log.Logger info INFO: hsbroker finalUri is https://192.168.1.150:29860 Jul 01, 2021 8:41:24 PM io.prestosql.jdbc.$internal.airlift.log.Logger info INFO: The final connection url is: presto://192.168.1.189:29896/hive/default Jul 01, 2021 8:41:24 PM io.prestosql.jdbc.$internal.airlift.log.Logger info INFO: coordinator uri is presto://192.168.1.189:29896/hive/default user_info user_info2
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.