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
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

Using a Client to Execute Query Statements

Updated on 2024-07-19 GMT+08:00

You can perform an interactive query on an MRS cluster client. For clusters with Kerberos authentication enabled, users who submit topologies must belong to the presto group.

The Presto component of MRS 3.x does not support Kerberos authentication.

Prerequisites

  • The password of user admin has been obtained. The password of user admin is specified by the user during MRS cluster creation.
  • The client has been updated.
  • The Presto client has been manually installed for MRS 3.x clusters.

Procedure

  1. For clusters with Kerberos authentication enabled, log in to MRS Manager and create a role with the Hive Admin Privilege permission.
  2. Create a user to the Presto and Hive groups, bind the role created in 1 to the user, and download the user authentication file..
  3. Upload the downloaded user.keytab and krb5.conf files to the node where the MRS client resides.

    NOTE:

    For clusters with Kerberos authentication enabled, 2 to 3 must be performed. For normal clusters, start from 4.

  4. Prepare a client based on service conditions and log in to the node where the client is installed.

    For example, if you have updated the client on the Master2 node, log in to the Master2 node to use the client. For details, see Using an MRS Client.

  5. Run the following command to switch the user:

    sudo su - omm

  6. Run the following command to switch to the client directory, for example, /opt/client.

    cd /opt/client

  7. Run the following command to configure environment variables:

    source bigdata_env

  8. Connect to the Presto Server. The following provides two client connection methods based on the client type.

    • Using the client provided by MRS
      • For clusters with Kerberos authentication disabled, run the following command to connect to the Presto Server of the cluster:

        presto_cli.sh

      • For clusters with Kerberos authentication disabled, run the following command to connect to the Presto Server of other clusters. In the command, ip indicates the floating IP address of the cluster Presto Server, which can be obtained by searching for PRESTO_COORDINATOR_FLOAT_IP in the Presto configuration items. port indicates the Presto Server port number and is set to 7520 by default.

        presto_cli.sh --server http://ip:port

      • For clusters with Kerberos authentication enabled, run the following command to connect to the Presto Server of the cluster:

        presto_cli.sh --krb5-config-path krb5.conf file path --krb5-principal User's principal --krb5-keytab-path user.keytab file path --user presto username

      • For clusters with Kerberos authentication enabled, run the following command to connect to the Presto Server of other clusters. In the command, ip indicates the floating IP address of the cluster Presto Server, which can be obtained by searching for PRESTO_COORDINATOR_FLOAT_IP in the Presto configuration items. port indicates the Presto Server port number and is set to 7521 by default.

        presto_cli.sh --krb5-config-path krb5.conf file path --krb5-principal User's principal --krb5-keytab-path user.keytab file path --server https://ip:port --krb5-remote-service-name Presto Server name

    • Using the native client

      The native client of Presto is Presto/presto/bin/presto in the client directory.

  9. Run a query statement, for example, show catalogs;.

    NOTE:

    For clusters with Kerberos authentication enabled, when querying Hive Catalog data, the user who runs the Presto client must have the permission to access Hive tables and run the grant all on table [table_name] to group hive; command in Hive beeline to grant permissions to the Hive group.

  10. After the query is complete, run the following command to exit the client:

    quit;

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