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
On this page

Show all

Commissioning the HBase Python Sample Program

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

Only MRS 1.9.x and earlier versions support this function.

HBase allows users to use the ThriftServer2 service to access HBase using Python. The Python sample program can run only in the Linux environment. To commission the HBase Python sample program, an ECS that can communicate with the cluster environment must be available. For details, see Preparing a Local Application Development Environment. In addition, the Python environment must be installed. For details about how to download the installation package, visit https://www.python.org/. The following describes how to run the sample on the master node of the cluster.

  1. Set up the sample running environment.

    Obtain the Python dependency for running the sample program, search for and download the decorator, gssapi, kerberos, krbcontext, pure-sasl, and thrift packages from https://pypi.org/. (If Kerberos authentication is not enabled for a common cluster, only the thrift package needs to be installed.) Upload the package to the master node. For example, create the /opt/hbase-examples/python directory and upload it to the directory.
    decorator-4.3.2.tar.gz
    gssapi-1.5.1.tar.gz
    kerberos-1.3.0.tar.gz
    krbcontext-0.8.tar.gz
    pure-sasl-0.6.1.tar.gz
    thrift-0.11.0.tar.gz

  2. Upload the hbase-python-example folder in the sample project to the /opt/hbase-examples directory on the master node of the cluster, and upload the authentication file obtained from Preparing an HBase Application Development User to the directory.
  3. Create the hbasepython.properties file in /opt/hbase-examples and modify the configuration as follows:

    clientHome=/opt/client
    exampleCodeDir=/opt/hbase-examples/hbase-python-example
    pythonLib=/opt/hbase-examples/python
    keyTabFile=/opt/hbase-examples/user.keytab
    userName=hbaseuser
    thriftIp=xxx.xxx.xx.xxx
    NOTE:

  4. Run the following command to create an HBase table named example:

    source /opt/client/bigdata_env

    kinit Username

    echo "create 'example','family1','family2'" | hbase shell

  5. Install the Python environment and run the program.

    cd /opt/hbase-examples/hbase-python-example
    sh initEnvAndRunDemo.sh /opt/hbase-examples/hbasepython.properties
    NOTE:
    • Format the initEnvAndRunDemo.sh script before running the program. For example, run the following command: dos2unix /opt/hbase-examples/hbasepython.properties
    • Before executing the script, ensure that the example table contains the column family 'family1''family2' and already exists in the cluster.
    • To run the program again, go to the /opt/hbase-examples/hbase-python-example directory and run the following command to execute the program commissioning example: python DemoClient.py

  6. After the HBase Python application is run, you can check the application running status by viewing the running result.

    Figure 1 Application running success

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