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

Restoring the HBase Table on MRS

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

After the CDH HBase table directories are migrated to MRS HBase, you can run commands to restore the directories. For data that may change, create snapshots to ensure that the data remains unchanged, and then migrate and restore the data.

Constraints

This solution supports only data migration to MRS 1.x clusters. In MRS 2.x and later versions, HBase tables cannot be rebuilt by running HBase repair commands.

NOTICE:

If the target cluster version is 2.x or later, the HBase repair command is no longer supported, and the HBase data directory migration cannot be implemented.

Running Commands to Restore the Data Remaining Unchanged

For example, to restore the /hbase/data/default/table_20180811 table, perform the following operations:
  1. Access the node where MRS Client is located, for example, master1.
  2. Run the following command to switch to user omm:

    su – omm

  3. Run the following command to load environment variables:

    source /opt/client/bigdata_env

  4. Run the following command to change the directory permission:

    hdfs dfs –chown omm:hadoop –R /hbase/data/default/table_20180811

    • omm:hadoop: Indicates the username. Replace it with the actual username.
    • /hbase/data/default/table_20180811: Indicates the path of the table.
  5. Run the following command to restore metadata:

    hbase hbck –fixMeta table_20180811

  6. Run the command to restore regions:

    hbase hbck –fixAssignments table_20180811

  7. If the message "Status: OK" is displayed, the table is restored successfully.

Using Snapshots to Migrate and Restore the Data that May Change

  1. Run the following command in the HBase shell of the source CDH cluster:

    flush <table name>

  2. Run the following command in the HBase shell of the source CDH cluster:

    compact <table name>

  3. If the Snap function is not enabled in the table, run the following command to enable the function:

    hadoop dfsadmin -allowSnapshot $path

  4. Run the following commands to create an HDFS snapshot named s0:

    hdfs dfs -createSnapshot <snapshotDir> [s0]

    hdfs dfs -createSnapshot test

  5. CDM copies files to MRS using the HDFS snapshot. Configure the migration job on CDM as follows:
    • Source Directory/File: /hbase/data/default/src_test/.snapshot/s0
    • Write Directory: /hbase/data/default/Table name
  6. Run the fixMeta and fixAssignments commands to restore the table. For details, see Running Commands to Restore the Data Remaining Unchanged.
  7. Run the following command to delete the snapshot from the CDH cluster:

    hdfs dfs -deleteSnapshot <snapshotDir> s0

Rectifying the Fault That Occurs When Restoring a Table

  1. After the fixMeta command is executed, the error message "xx inconsistent" is displayed.

    The fixMeta command is used to check the consistency of metadata between HDFS and HBase. This is a normal situation. Proceed to run the fixAssignments command.

  2. After the fixAssignments command is executed, the error message "xx inconsistent" is displayed.

    The fixAssignments command is used to restore all regions. Sometimes, some regions go online slowly. You can run the following command to check whether the HBase table is successfully restored:

    hbase hbck Table name

    If the message "Status: OK" is displayed, the HBase table is restored successfully.

  3. After the fixAssignments command is executed, an error message is displayed, indicating that multiple regions have the same startkey and some regions overlap.

    Run the following command:

    hbase hbck –fixHdfsOverlaps Table name

    Then run the fixMeta and fixAssignments commands.

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