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

Changing the DataNode Storage Directory

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

Scenario

NOTE:

This section applies to MRS 3.x or later.

If the storage directory defined by the HDFS DataNode is incorrect or the HDFS storage plan changes, the MRS cluster administrator needs to modify the DataNode storage directory on FusionInsight Manager to ensure smooth HDFS running. Changing the ZooKeeper storage directory includes the following scenarios:

  • Change the storage directory of the DataNode role. In this way, the storage directories of all DataNode instances are changed.
  • Change the storage directory of a single DataNode instance. In this way, only the storage directory of this instance is changed, and the storage directories of other instances remain the same.

Impact on the System

  • The HDFS service needs to be stopped and restarted during the process of changing the storage directory of the DataNode role, and the cluster cannot provide services before it is completely started.
  • The DataNode instance needs to stopped and restarted during the process of changing the storage directory of the instance, and the instance at this node cannot provide services before it is started.
  • The directory for storing service parameter configurations must also be updated.

Prerequisites

  • New disks have been prepared and installed on each data node, and the disks are formatted.
  • New directories have been planned for storing data in the original directories.
  • The HDFS client has been installed.
  • The service user hdfs has been created.
  • When changing the storage directory of a single DataNode instance, ensure that the number of active DataNode instances is greater than the value of dfs.replication.

Procedure

Check the environment.

  1. Log in to the server where the HDFS client is installed as user root, and run the following command to configure environment variables:

    source Installation directory of the HDFS client/bigdata_env

  2. If the cluster is in security mode, run the following command to authenticate the user:

    kinit hdfs

  3. Run the following command on the HDFS client to check whether all directories and files in the HDFS root directory are normal:

    hdfs fsck /

    Check the fsck command output.

    • If the following information is displayed, no file is lost or damaged. Go to 4.
      The filesystem under path '/' is HEALTHY
    • If other information is displayed, some files are lost or damaged. Go to 5.

  4. Log in to FusionInsight Manager, choose Cluster > Services, and check whether Running Status of HDFS is Normal.

    • If yes, go to 6.
    • If no, the HDFS status is unhealthy. Go to 5.

  5. Rectify the HDFS fault. The task is complete.
  6. Determine whether to change the storage directory of the DataNode role or that of a single DataNode instance:

    • To change the storage directory of the DataNode role, go to 7.
    • To change the storage directory of a single DataNode instance, go to 12.

Changing the storage directory of the DataNode role

  1. Choose Cluster > Services > HDFS and click Stop Service to stop the HDFS service.
  2. Log in as user root to each node on which the HDFS service is installed, and perform the following operations:

    1. Create a target directory (data1 and data2 are original directories in the cluster).

      For example, if the target directory is ${BIGDATA_DATA_HOME}/hadoop/data3/dn, run the following command:

      mkdir -p ${BIGDATA_DATA_HOME}/hadoop/data3/dn

    2. Mount the target directory to the new disk. For example, mount ${BIGDATA_DATA_HOME}/hadoop/data3 to the new disk.
    3. Modify permissions on the new directory.

      For example, if the new directory is ${BIGDATA_DATA_HOME}/hadoop/data3/dn, run the following command:

      chmod 700 ${BIGDATA_DATA_HOME}/hadoop/data3/dn -R

      chown omm:wheel ${BIGDATA_DATA_HOME}/hadoop/data3/dn -R

    4. Copy the data to the target directory.

      For example, if the original directory is ${BIGDATA_DATA_HOME}/hadoop/data1/dn and the target directory is ${BIGDATA_DATA_HOME}/hadoop/data3/dn, run the following command:

      cp -af ${BIGDATA_DATA_HOME}/hadoop/data1/dn/* ${BIGDATA_DATA_HOME}/hadoop/data3/dn

  3. On FusionInsight Manager, choose Cluster > Services > HDFS and click Configurations then All Configurations to access the HDFS service configuration page.

    Change the value of dfs.datanode.data.dir from the default value %{@auto.detect.datapart.dn} to the new target directory, for example, ${BIGDATA_DATA_HOME}/hadoop/data3/dn.

    For example, the original data storage directories are /srv/BigData/hadoop/data1, /srv/BigData/hadoop/data2. To migrate data from the /srv/BigData/hadoop/data1 directory to the newly created /srv/BigData/hadoop/data3 directory, replace the whole parameter with /srv/BigData/hadoop/data2, /srv/BigData/hadoop/data3. Separate multiple storage directories with commas (,). In this example, changed directories are /srv/BigData/hadoop/data2, /srv/BigData/hadoop/data3.

  4. Click Save. On the Cluster > Services page, start each stopped service in the cluster.
  5. After the HDFS is started, run the following command on the HDFS client to check whether all directories and files in the HDFS root directory are correctly copied:

    hdfs fsck /

    Check the fsck command output.

    • If the following information is displayed, no file is lost or damaged, and data replication is successful. No further action is required.
      The filesystem under path '/' is HEALTHY
    • If other information is displayed, some files are lost or damaged. Check whether 8.d is correct and run the following command:

      hdfs fsck Name of the damaged file -delete

Changing the storage directory of a single DataNode instance

  1. Choose Cluster > Services > HDFS and click Instances. Select the DataNode whose storage directory needs to be modified, click More, and select Stop Instance.

  2. Log in to the DataNode node as user root, and perform the following operations:

    1. Create a target directory.

      For example, if the target directory is ${BIGDATA_DATA_HOME}/hadoop/data3/dn, run the following command:

      mkdir -p ${BIGDATA_DATA_HOME}/hadoop/data3/dn

    2. Mount the target directory to the new disk.

      For example, mount ${BIGDATA_DATA_HOME}/hadoop/data3 to the new disk.

    3. Modify permissions on the new directory.

      For example, if the new directory is ${BIGDATA_DATA_HOME}/hadoop/data3/dn, run the following command:

      chmod 700 ${BIGDATA_DATA_HOME}/hadoop/data3/dn -R

      chown omm:wheel ${BIGDATA_DATA_HOME}/hadoop/data3/dn -R

    4. Copy the data to the target directory.

      For example, if the original directory is ${BIGDATA_DATA_HOME}/hadoop/data1/dn and the target directory is ${BIGDATA_DATA_HOME}/hadoop/data3/dn, run the following command:

      cp -af ${BIGDATA_DATA_HOME}/hadoop/data1/dn/* ${BIGDATA_DATA_HOME}/hadoop/data3/dn

  3. On FusionInsight Manager, choose Cluster > Services > HDFS and click Instance. Click the specified DataNode instance and go to the Configurations tab page.

    Change the value of dfs.datanode.data.dir from the default value %{@auto.detect.datapart.dn} to the new target directory, for example, ${BIGDATA_DATA_HOME}/hadoop/data3/dn.

    For example, the original data storage directories are /srv/BigData/hadoop/data1,/srv/BigData/hadoop/data2. To migrate data from the /srv/BigData/hadoop/data1 directory to the newly created /srv/BigData/hadoop/data3 directory, replace the whole parameter with /srv/BigData/hadoop/data2,/srv/BigData/hadoop/data3.

  4. Click Save, and then click OK.

    Operation succeeded is displayed. click Finish.

  5. Choose More > Restart Instance to restart the DataNode instance.

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