このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Commissioning a Hive JDBC Application on Windows

Updated on 2024-08-16 GMT+08:00

Running the JDBC Client Using CLI

  1. Run the sample project.

    After you import and modify the sample project according to Preparing a Hive JDBC Development Environment, download the hiveclient.properties file from the /opt/client/Hive/config/hiveclient.properties directory of any master node in the cluster, and save the file to the conf directory of the sample project, that is, hive-examples/conf. Then, you can right-click JDBCExample.java in the development environment, for example, Eclipse, and choose Run as > Java Application to run the corresponding application project.
    NOTE:

    You can use either of the following method to access an MRS cluster to operate Hive on Windows.

    • Apply for a Windows ECS to access the MRS cluster to operate Hive. This method provides high availability because it obtains dynamic HiveServer address by connecting to ZooKeeper to operate Hive.
    • Use the local host to access the MRS cluster to operate Hive. Because the network between the local host and MRS cluster is disconnected, Hive can be operated only by directly connecting to HiveServer.
    Method 1: Apply for a Windows ECS to access the MRS cluster to operate Hive. Run the sample code after the development environment is installed. To apply for ECS to access the MRS cluster, perform the following steps:
    1. On the Active Clusters page, click the name of an existing cluster.

      On the cluster details page, record the AZ, VPC, Cluster Manager IP Address of the cluster, and Default Security Group of the Master node.

    2. 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 Hive. After installing the development environment and completing the following steps, run the sample code.

    1. Bind an EIP to the HiveServer or ZooKeeper node that will use the Hive service in the MRS cluster. To bind an EIP, perform the following steps:
      1. On the VPC management console, apply for an EIP and bind it to ECS.

        For details, see Virtual Private Cloud > User Guide > Elastic IP Address > Assigning an EIP and Binding It to an ECS.

      2. Open security group rules for the MRS cluster.

        Add security group rules to a security group of the Master and Core nodes in the cluster to enable the ECS to access the cluster. If the cluster is a security cluster, you need to enable UDP ports 21731 and 21732 and TCP ports 21730, 21731, and 21732. Add the HiveServer instance port and ZooKeeper service port of Hive to the inbound rule of the security group. For details, see Virtual Private Cloud > User Guide > Security > Security Group > Adding a Security Group Rule.

    2. Modify the imported hiveclient.properties file to make the zk.quorum parameter correspond to the EIP bound to HiveServer and the ZooKeeper port. Modify the URL combination for connecting to the JDBC in the sample code. For details about how to directly connect to HiveServer, see Analyzing Hive Data.
    3. Change the IP addresses of the kdc, admin_server, kpasswd_server, kdc_listen, kadmind_listen, and kpasswd_listen parameters in the krb5.conf file of the import example (if the cluster has only one master node, you do not need to modify the last three parameters). Map it to the EIP of the KrbServer service (skip this step if the Kerberos function is not enabled for the common cluster). Save the modified krb5.conf and user.keytab file to the conf directory of the sample project.
    4. If you access Hive using ZooKeeper, add the mapping between the EIPs bound to the nodes in 1 and host names in the local hosts file.
    5. If error message "Message stream modified (41)" is displayed, the JDK version may be incorrect. Change the JDK version in the sample code to a version earlier than 8u_242 or delete the renew_lifetime = 0m configuration item from the krb5.conf configuration file.

  2. View the execution result.

    View the HiveQL 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!

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback