El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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
Help Center/ MapReduce Service/ Best Practices/ Interconnection with Other Cloud Services/ Connecting to the OBS File System with an MRS Hive Table

Connecting to the OBS File System with an MRS Hive Table

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

MRS allows you to store data in OBS and use an MRS cluster for data computing only. In this way, storage and compute are decoupled. You can use the IAM service to perform simple configurations to access OBS.

This section describes how to create a Hive table to store data to OBS.

  1. Creating an ECS Agency
  2. Configuring an Agency for an MRS Cluster
  3. Creating an OBS File System
  4. Accessing the OBS File System Through Hive

Creating an ECS Agency

  1. Log in to the Huawei Cloud management console.
  2. Choose Service List > Management & Governance > Identity and Access Management.
  3. Click Agencies. On the displayed page, click Create Agency.
  4. Enter an agency name, for example, mrs_ecs_obs.
  5. Set Agency Type to Cloud service and select ECS BMS to authorize ECS or BMS to invoke OBS.
  6. Set Validity Period to Unlimited and click Next.
    Figure 1 Creating an agency
  7. On the page that is displayed, search for OBS OperateAccess in the search box and select it in the result list.
    Figure 2 Assigning permissions
  8. Click Next. On the page that is displayed, select the desired scope for the permissions you selected. By default, All resources is selected. Click Show More, select Global resources, and click OK.
  9. In the dialog box that is displayed, click OK to start authorization. After the message "Authorization successful." is displayed, click Finish. The agency is created successfully.

Configuring an Agency for an MRS Cluster

You can configure an agency when creating a cluster or bind an agency to an existing cluster to decouple storage and compute. This section uses an existing cluster as an example to describe how to configure an agency.

  1. Log in to the MRS management console. In the left navigation pane, choose Active Clusters.
  2. Click the name of a cluster to go to the cluster details page.
  3. On the Dashboard page, click Synchronize on the right side of IAM User Sync to synchronize IAM users.
  4. On the Dashboard page, click Manage Agency on the right side of Agency to select the agency created in Creating an ECS Agency, and click OK to bind it to the cluster. Alternatively, click Create Agency to go to the IAM console to create an agency and bind it to the cluster.
    Figure 3 Binding an agency

Creating an OBS File System

  1. Log in to the OBS console.
  2. Choose Parallel File System > Create Parallel File System.
  3. Enter the file system name, for example, mrs-demo01.

    Set other parameters as required.

    Figure 4 Creating a parallel file system
  4. Click Create Now.
  5. In the parallel file system list on the OBS console, click a file system name to go to the details page.
  6. In the navigation pane, choose Files and create program and input folders.
    • program: Upload the program package to this folder.
    • input: Upload the input data to this folder.

Accessing the OBS File System Through Hive

  1. Log in to a master node as user root. For details, see Logging In to an ECS.
  2. Verify that Hive can access OBS.
    1. Log in to the master node of the cluster as user root and run the following commands:

      cd /opt/Bigdata/client

      source bigdata_env

      source Hive/component_env

    2. View the list of files in file system mrs-demo01.

      hadoop fs -ls obs://mrs-demo01/

    3. Check whether the file list is returned. If it is returned, access to OBS is successful.
      Figure 5 Viewing the file list in mrs-demo01
    4. Run the following command to authenticate the user (skip this step for a normal cluster, that is, with Kerberos authentication disabled):

      kinit hive

      Enter the password of user hive. The default password is Hive@123. Change the password upon the first login.

    5. Run the Hive client command.

      beeline

    6. Access the OBS directory in the Beeline. For example, run the following command to create a Hive table and specify that data is stored in the test_demo01 table of file system mrs-demo01:

      create table test_demo01(name string) location "obs://mrs-demo01/test_demo01";

    7. Run the following command to query all tables. If the test_demo01 table is displayed in the command output, the access to OBS is successful.

      show tables;

      Figure 6 Checking whether the test_demo01 table exists
    8. Run the following command to check the table location.

      show create table test_demo01;

      Check whether the location of the table starts with obs://OBS bucket name/.

      Figure 7 Checking the location of the test_demo01 table
    9. Run the following command to write data into the table.

      insert into test_demo01 values('mm'),('ww'),('ww');

      Run the select * from test_demo01; command to check whether the data is written successfully.

      Figure 8 Viewing data in the test_demo01 table
    10. Run the !q command to exit the Beeline client.
    11. Log in to the OBS console again.
    12. Click Parallel File System and select the created file system.
    13. Click Files to check whether the data exists in the created table.
      Figure 9 Viewing data

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback