Commissioning an Impala JDBC Application on Windows
Running the JDBC Client Using CLI
- Run the sample project.
After importing and modifying the sample project according to Preparing the Impala JDBC Client, save the keytab file obtained from MRS Manager of the cluster to the conf directory of the sample project, that is, impala-examples/conf. You can skip this step for a common cluster. In the development environment (for example, Eclipse), right-click JDBCExample.java and choose from the shortcut menu to run the corresponding application project.
You can use either of the following method to access an MRS cluster to operate Impala on Windows.
- Apply for a Windows ECS to access the MRS cluster to operate Impala.
- Use the local host to access the MRS cluster to operate Impala.
Method 1: Apply for a Windows ECS to access the MRS cluster to operate Impala. Run the sample code after the development environment is installed. To apply for ECS to access the MRS cluster, perform the following steps:- On the Active Clusters page, click the name of an existing cluster.
On the cluster details page, record the AZ, VPC, and Default Security Group of the Master node.
- On the ECS management console, create a new ECS.
The AZ, VPC, and security group of ECS must be the same as those of the cluster to be accessed.
Select a Windows public image.
For details about other configuration parameters, see Elastic Cloud Server > Quick Start > Purchasing and Logging In to a Windows ECS.
Method 2: Use the local host to access the MRS cluster to operate Impala. After installing the development environment and completing the following steps, run the sample code.
- Bind an EIP address to any Core node. Then, configure the IP address in the impala-server configuration item in the client.properties file of the development sample to access the Impala service and submit SQL statements. To bind an EIP, perform the following steps:
- Modify the IP addresses of the kdc, admin_server, and kpasswd_server parameters in the krb5.conf file of the imported sample to the EIPs corresponding to KrbServer. (The Kerberos service is deployed on the master node by default. Therefore, the public IP address of the master node is used.) (Skip this step for common clusters with the Kerberos function disabled.)
The client.properties configuration in the sample is as follows:
auth = KERBEROS ## Kerberos mode principal = impala/node-ana-corexphm@10530B19_8446_4846_97BD_87880A2535DF.COM ## Principal used by the Impalad instance to be connected impala-server = XX.XX.XX.XX:21050 ## Specifies the service address bound to the Core node where the Impalad instance to be connected is located. If method 2 is used, enter the EIP bound in step 1.
- View the execution result.
View the Impala SQL query results in the sample code. If the following information is displayed, the execution is successful.
Result:
Create table success! _c0 0 Delete table success!
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot