Updated on 2024-04-02 GMT+08:00

Commissioning Applications on Windows

Scenario

After the program code is developed, you can compile the program in the Windows environment. If the network between the local and the cluster service plane is normal, you can perform the commissioning on the local host.

Procedure

  1. In the IntelliJ IDEA development environment on Windows, check that the user.keytab and krb5.conf files obtained in Preparing for Security Authentication are saved to the resources directory, and modify the parameters in the jaas-zk.conf file based on the actual path and username.

    Figure 1 Saving the authentication file to the resources directory

  2. Click Maven on the right of IDEA to import the dependency.

    Figure 2 Importing the dependency

  3. (Optional) If the SSL authentication communication function of ZooKeeper is enabled for the interconnected cluster, add the JVM configuration

    -Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty -Dzookeeper.client.secure=true when you run JDBCExampleZk and JDBCExamplePasswordZK.

  4. Right-click the *.java file of the sample project and choose Run'*.main()' from the shortcut menu. Wait until the execution is successful. (The default sample is to query a Hive table.)

    • The running result of the JDBCExampleZk example application is shown as follows:
      ...
      principal is hivetest@HADOOP.COM
      Will use keytab
      Commit Succeeded 
      ...
      The final connection url is: XXX://192.168.1.189:29896/hive/default
      Table	
      user_info	
      user_info2	
    • The running result of the JDBCExamplePasswordZK example application is as follows:
      ...
      The final connection url is: XXX://192.168.1.189:29896/hive/default
      Table	
      user_info	
      user_info2	
    • The running result of the JDBCExampleBroker example application is as follows:
      ...
      The final connection url is: XXX://192.168.1.189:29896/hive/default
      coordinator uri is XXX:/192.168.1.189:29896/hive/default
      user_info	
      user_info2