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 ZooKeeper Storage Directory

Updated on 2022-12-14 GMT+08:00

Scenario

When the defined storage directory of ZooKeeper is incorrect, or when the storage plan of ZooKeeper is changed, log in to FusionInsight Manager to change the storage directory of ZooKeeper to ensure ZooKeeper runs properly. The storage directory of ZooKeeper includes the local data storage directory dataDir. Changing the ZooKeeper storage directory includes the following scenarios:

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

Impact on the System

  • ZooKeeper and associated services needs to be stopped and restarted during the process of changing the storage directory of ZooKeeper, and the cluster cannot provide services before restarted.
  • The ZooKeeper instance needs to stopped and restarted during the process of changing the storage directory of the instance, and the ZooKeeper instance at this node cannot provide services before restarted.

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 MRS cluster administrator account admin has been prepared.

Procedure

Check the environment.

  1. Log in to FusionInsight Manager, choose Cluster > Name of the desired cluster > Services to check whether Running Status of ZooKeeper is Normal.

    • If yes, go to 3.
    • If no, the ZooKeeper status is unhealthy. Go to 2.

  2. Rectify the ZooKeeper fault.
  3. Determine whether to change the storage directory of the ZooKeeper role or that of a ZooKeeper instance:

    • To change the storage directory of the ZooKeeper role, go to 4.
    • To change the storage directory of a single ZooKeeper instance, go to 9.

Change the storage directory of the ZooKeeper role.

  1. Choose Cluster > Name of the desired cluster > Services > ZooKeeper > Stop to stop the ZooKeeper service.
  2. Log in to each node where the ZooKeeper service is installed as user root and perform the following operations:

    1. Create a target directory.

      For example, to create the target directory ${BIGDATA_DATA_HOME}/zookeeper2, run the following command:

      mkdir ${BIGDATA_DATA_HOME}/zookeeper2.

    2. Format the new disk, and mount the target directory to the new disk. For example, mount ${BIGDATA_DATA_HOME}/zookeeper2 to the new disk.
    3. Modify permissions on the new directory.

      For example, the new directory is ${BIGDATA_DATA_HOME}/zookeeper2.

      Run chmod 700 ${BIGDATA_DATA_HOME}/zookeeper2 and chown omm:wheel ${BIGDATA_DATA_HOME}/zookeeper2.

    4. Run the following commands to copy the original data to the new directory:

      For example, run cp -pr ${BIGDATA_DATA_HOME}/zookeeper/version-2/ ${BIGDATA_DATA_HOME}/zookeeper2/

      cp -pr ${BIGDATA_DATA_HOME}/zookeeper/myid ${BIGDATA_DATA_HOME}/zookeeper2/

  3. On FusionInsight Manager, choose Cluster > Name of the desired cluster > Service > ZooKeeper > Configuration to go to the configuration page of the ZooKeeper service.

    Set dataDir of ZooKeeper and quorumpeer to the new target directory, such as ${BIGDATA_DATA_HOME}/zookeeper2.

  4. Click Save, and then click OK. Restart the ZooKeeper service.

    Click Finish when the system displays "Operation successful". ZooKeeper is successfully started.

  5. Rename the original storage directory ${BIGDATA_DATA_HOME}/zookeeper. If the directory is a root directory that is mounted to an independent disk, remove the disk before renaming the directory and no further action is required.

Change the storage directory of a single ZooKeeper instance.

  1. Choose Cluster > Name of the desired cluster > Service > ZooKeeper > Instances. Select the ZooKeeper instance whose storage directory needs to be modified, and choose More > Stop Instance.
  2. Log in to the ZooKeeper node as user root, and perform the following operations:

    1. Create a target directory.

      For example, to create the target directory ${BIGDATA_DATA_HOME}/zookeeper2, run the following command:

      mkdir ${BIGDATA_DATA_HOME}/zookeeper2.

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

      For example, to modify permissions on the ${BIGDATA_DATA_HOME}/yarn/data2 directory, run the following commands:

      chmod 700 ${BIGDATA_DATA_HOME}/zookeeper2 and chown omm:wheel ${BIGDATA_DATA_HOME}/zookeeper2

    4. Run the following commands to copy the original data to the new directory:

      For example, run cp -pr ${BIGDATA_DATA_HOME}/zookeeper/version-2/ ${BIGDATA_DATA_HOME}/zookeeper2/

      cp -pr ${BIGDATA_DATA_HOME}/zookeeper/myid ${BIGDATA_DATA_HOME}/zookeeper2/

  3. On FusionInsight Manager, click the specified ZooKeeper instance, and switch to the Instance Configuration page.

    Set dataDir of ZooKeeper and quorumpeer to the new target directory, such as ${BIGDATA_DATA_HOME}/zookeeper2.

  4. Click Save, and then click OK. Restart the ZooKeeper instance.

    Click Finish when the system displays "Operation successful". The ZooKeeper instance is successfully started.

  5. Rename the original storage directory ${BIGDATA_DATA_HOME}/zookeeper. If the directory is a root directory that is mounted to an independent disk, remove the disk before renaming the directory and no further action is required.

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