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

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

Scenario

This section applies to MRS 3.x or later.

When a broker storage directory is added, the system administrator needs to change the broker storage directory on FusionInsight Manager, to ensure that the Kafka can work properly. The new topic partition will be generated in the directory that has fewest partitions. Changing the ZooKeeper storage directory includes the following scenarios:

NOTE:

Because Kafka does not detect disk capacity, ensure that the disk quantity and capacity configured for each Broker instance are the same.

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

Impact on the System

  • Changing the Broker role storage directory requires the restart of services. The services cannot be accessed during the restart.
  • The storage directory of a single Broker instance can be changed only after the instance is restarted. The instance cannot provide services during the restart.
  • 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.
  • The Kafka client has been installed.
  • When you change the storage directory of a single Broker instance, the number of active Broker instances must be greater than the number of backups specified during topic creation.

Procedure

Changing the storage directory of the Kafka role

  1. Log in as user root to each node on which the Kafka service is installed, and perform the following operations:

    1. Create a target directory.

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

      mkdir ${BIGDATA_DATA_HOME}/kafka/data2

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

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

      chmod 700 ${BIGDATA_DATA_HOME}/kafka/data2 -R and chown omm:wheel ${BIGDATA_DATA_HOME}/kafka/data2 -R

  2. Log in to FusionInsight Manager for clusters of MRS 3.x or later and choose Cluster > Services > Kafka > Configurations.
  3. Add a new directory to the end of the default value of log.dirs.

    Enter log.dirs in the search box and add the new directory to the end of the default value of the log.dirs configuration item. Use commas (,) to separate multiple directories. For example:

    ${BIGDATA_DATA_HOME}/kafka/data1/kafka-logs,${BIGDATA_DATA_HOME}/kafka/data2/kafka-logs

  4. Click Save, and then click OK. When Operation succeeded is displayed, click Finish.
  5. Choose Cluster > Services > Kafka. In the upper right corner, choose More > Restart Service to restart the Kafka service.

Changing the storage directory of a single Kafka instance

  1. Log in to the Broker node as user root and perform the following operations:

    1. Create a target directory.

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

      mkdir ${BIGDATA_DATA_HOME}/kafka/data2

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

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

      chmod 700 ${BIGDATA_DATA_HOME}/kafka/data2 -R and chown omm:wheel ${BIGDATA_DATA_HOME}/kafka/data2 -R

  2. Log in to FusionInsight Manager for MRS 3.x or later, and choose Cluster > Services > Kafka > Instance.
  3. Click the specified broker instance and switch to Instance Configurations.

    Enter log.dirs in the search box and add the new directory to the end of the default value of the log.dirs configuration item. Use commas (,) to separate multiple directories, for example, ${BIGDATA_DATA_HOME}/kafka/data1/kafka-logs,${BIGDATA_DATA_HOME}/kafka/data2/kafka-logs.

  4. Click Save, and then click OK. A message is displayed, indicating that the operation is successful. Click Finish.
  5. On the Broker instance page, choose More > Restart Instance to restart the Broker instance.

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