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
Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using HetuEngine/ Quickly Using HetuEngine to Access Hive Data Source

Quickly Using HetuEngine to Access Hive Data Source

Updated on 2024-10-09 GMT+08:00

This section describes how to use HetuEngine to connect to the Hive data source and query database tables of the Hive data source of the cluster through HetuEngine.

Prerequisites

  • The HetuEngine and Hive services and their dependent services (DBService, KrbServer, ZooKeeper, HDFS, Yarn, and MapReduce) have been installed in the cluster and are running properly.
  • If Kerberos authentication has been enabled for the cluster, you need to create a HetuEngine user and grant related permissions to the user in advance. For details, see Creating a HetuEngine Permission Role. In addition, you need to configure the permissions to manage the databases, tables, and columns of the data source for the user using Ranger. For details, see Adding a Ranger Access Permission Policy for HetuEngine.
  • The cluster client has been installed in a directory, for example, /opt/client.

Procedure

  1. Create and start a HetuEngine compute instance.

    1. Log in to FusionInsight Manager as a HetuEngine administrator and choose Cluster > Services > HetuEngine. The HetuEngine service page is displayed.
    2. In the Basic Information area on the Dashboard tab page, click the link next to HSConsole WebUI. The HSConsole page is displayed.
    3. Click Compute Instance then Create Configuration.
      1. In the Basic Configuration area, set Tenant to the tenant associated with the user and configure Instance Deployment Timeout Period (s) and Node Count.
      2. Configure parameters in the Coordinator Container Resource Configuration, Worker Container Resource Configuration, and Advanced Configuration areas based on the actual resource plan. For details about the parameter configuration, see Creating a HetuEngine Compute Instance or retain the default values.
        NOTICE:

        When you create a compute instance, you only need to apply for a few resources to test basic functions. You need to configure parameters based on actual service requirements and available resources. For details, see Configuring HetuEngine Resource Groups and Configuring the Number of HetuEngine Worker Nodes.

      3. Set Start Now to Yes, click OK, and wait until the instance configuration is complete.

  2. Log in to the node where the HetuEngine client is installed and run the following command to switch to the client installation directory:

    cd /opt/client

  3. Run the following command to configure environment variables:

    source bigdata_env

  4. Authenticate or specify a user.

    • For a cluster in security mode, run the following command to authenticate the user:

      kinit HetuEngine operation user

      Example:

      kinit hetu_test

      Enter the password as prompted and change the password upon your first login.

    • For a cluster in normal mode, run the following command to authenticate the user:

      hetu-cli --user HetuEngine operation user

      Example:

      hetu-cli --user hetu_test

  5. Run the following command to log in to the catalog of the data source. You can choose to log in to the data source through ZooKeeper or HSFabric by configuring the --mode parameter.

    • Through ZooKeeper (This mode is used by default if --mode is not configured.)

      hetu-cli --catalog Data source name

      For example, run the following command:

      hetu-cli --catalog hive

    • Through HSFabric (Ensure that HSFabric instances exist.)

      hetu-cli --mode hsfabric --catalog Data source name

      For example, run the following command:

      hetu-cli --mode hsfabric --catalog hive

    NOTE:
    • The default name of the Hive data source of the cluster is hive. To connect to data sources outside the cluster, configure external data sources on HSConsole by referring to Adding a HetuEngine Data Source.
    • It takes about 120 seconds for your first login to the client because the HetuEngine cluster needs to be started in the background.
    • Method to enable strict tenant verification for MRS 3.3.0 and later versions:

      HetuEngine provides service-level default resource queue configuration items. If no tenant information is specified, the default Yarn tenant is used. Multiple users may use the same queue by default.

      If you need to isolate resources and properly allocate SQL statements to specified queues, you can enable strict tenant verification by setting tenant.strict.mode.enabled to true and use the --tenant parameter to specify the queues when you use the client.

      Log in to Manager, choose Cluster > Services > HetuEngine, click Configurations and then All Configurations, search for tenant.strict.mode.enabled, set it to true, and save the settings. Click Instance, select all instances whose configurations expired, click More, select Restart Instance, and restart the instances as prompted for the configurations to take effect.

    • If strict tenant verification is enabled and cross-domain functions of HetuEngine are used, you need to set the hsfabric.local.tenant parameter of the HetuEngine data source. For details, see Adding a Cross-Cluster HetuEngine Data Source.

    Parameter description

    • --mode: Optional. The mode used to log in to a data source.
    • --catalog: Optional. The name of a specified data source.
    • --tenant: Optional. The tenant resource queue started by the cluster. If this parameter is not specified, the default tenant queue is used. To use this parameter, the service user must have the role permission of the tenant. For a cluster of MRS 3.3.0 or later versions:
      • This parameter is mandatory if strict verification is disabled.
      • This parameter is mandatory if strict verification is enabled.
    • --schema: Optional. The name of the schema of the data source to be accessed.
    • --user: Mandatory in normal mode. The name of the user who logs in to the client to execute services. The user must have at least the role of the queue specified by --tenant and cannot be an OS user.
    • You can run the hetu-cli --help command to view other parameters.
    java -Djava.security.auth.login.config=/opt/client/HetuEngine/hetuserver/conf/jaas.conf -Dzookeeper.sasl.clientconfig=Client -Dzookeeper.auth.type=kerberos -Djava.security.krb5.conf=/opt/client/KrbClient/kerberos/var/krb5kdc/krb5.conf -Djava.util.logging.config.file=/opt/client/HetuEngine/hetuserver/conf/hetuserver-client-logging.properties -jar /opt/client/HetuEngine/hetuserver/jars/hetu-cli-*-executable.jar --catalog hive --deployment-mode on_yarn --server https://10.112.17.189:24002,10.112.17.228:24002,10.112.17.150:24002?serviceDiscoveryMode=zooKeeper&zooKeeperNamespace=hsbroker --krb5-remote-service-name HTTP --krb5-config-path /opt/client/KrbClient/kerberos/var/krb5kdc/krb5.conf
    hetuengine> 

  6. Run the following command to view the database information:

    show schemas;
         Schema
    --------------------
     default
     information_schema
    (2 rows)
    Query 20230228_064136_00023_9kpap@default@HetuEngine, FINISHED, 3 nodes
    Splits: 36 total, 36 done (100.00%)
    0:02 [2 rows, 35B] [0 rows/s, 15B/s]

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