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

Modifying Kafka Topic Replicas

Updated on 2025-02-14 GMT+08:00

The replicas of a Kafka topic can be modified as required.

Reassigning partitions can modify replicas automatically or manually on the Kafka console. For more information, see Modifying Replicas by Automatic Reassignment and Modifying Replicas by Manual Reassignment.

Notes and Constraints

  • Unavailable for single-node instances.
  • Reassignment tasks cannot be manually stopped. Please wait until they complete.
  • If partition reassignment has been scheduled, reassignment cannot be scheduled again for any topic in this instance until this reassignment is executed.

Operation Impact

  • Partition reassignment on topics with a large amount of data consumes a large amount of network and storage bandwidth. As a result, service requests may time out or the latency may increase. Therefore, you are advised to perform reassignment during off-peak hours. Compare the current instance load based on the instance specifications to decide whether the remaining instance capacity can support partition reassignment. Do not reassign partitions when there is insufficient bandwidth or when the CPU usage is greater than 90%. To view data volume and CPU usage of a topic, see Message Size and CPU Usage on the monitoring page. For details, see Viewing Kafka Metrics.
  • A throttle refers to the upper limit of the bandwidth for replication of a topic, to ensure that other topics on the instance are not affected. Note that throttles apply to replication triggered by both normal message production and partition reassignment. If the throttle is too small, normal message production may be affected, and partition reassignment may never complete. If partitions are continuously reassigned, contact customer service.
  • You cannot delete topics whose reassignment tasks have started. Otherwise, the tasks will never complete.
  • After partition reassignment, the metadata of the topic changes. If the producer does not support the retry mechanism, a few requests will fail, causing some messages to fail to be produced.
  • Reassignment takes longer for a topic with a large data volume. To check the volume, see the Message Size metric on the monitoring page by referring to Viewing Kafka Metrics. To reduce the amount of data to be migrated, decrease the topic aging time without affecting services and wait for messages to age. After the reassignment is complete, you can restore the aging time.

Prerequisite

The target broker should have sufficient disk space. To check available disk space of each broker, see Viewing Kafka Disk Usage. If the remaining disk capacity of the target broker is close to the amount of data to be migrated to the broker, expand the disk capacity before the reassignment.

Modifying Replicas by Automatic Reassignment

  1. Log in to the console.
  2. Click in the upper left corner to select the region where your instance is located.
  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. In the navigation pane, choose Kafka Instances.
  5. Click the desired instance to go to the instance details page.
  6. In the navigation pane, choose Topics.
  7. Go to the Auto page in either of the following ways:

    • Select one or more topics and choose Reassign > Auto above the topic list.
    • In the row containing the desired topic, choose More > Reassign > Auto.

  8. Modify the replicas.

    Table 1 Parameters of automatic reassignment

    Parameter

    Description

    Broker Name

    Select the brokers to assign the topic's partition replicas to.

    Replicas

    Enter the number of replicas. This number must be less than or equal to the number of brokers.

    Max. Bandwidth

    Specify throttle. The default value is -1, indicating that there is no throttle.

    If the instance has low workload (for example, only 30/300 MB/s is used), you are not advised to limit the bandwidth. Otherwise, you are advised to set it to a value greater than or equal to the total production bandwidth of the to-be-reassigned topic multiplied by the maximum number of replicas of the to-be-reassigned topic.

    For details, see Calculating a Throttle.

    Execute

    Specify when to execute the reassignment.

    • Now means to execute it immediately.
    • As scheduled means to execute it at the scheduled time.

  9. (Optional) Click Calculate. Time Required indicates how long automatic balancing will take.

    The one-click calculation function does not affect the performance of Kafka instances.

  10. Click OK.

    The following table lists how to check whether reassignment is complete (scheduled and non-scheduled tasks):

    Table 2 Checking the reassignment result

    Task Type

    Reassignment Result

    Background tasks

    In the upper left corner of the topic list, click View details and the Background Tasks > Background tasks page is displayed. The reassignment task is complete when it is in the Successful state, which means that the replicas are modified.

    Scheduled tasks

    1. The Background Tasks > Scheduled tasks page is displayed. This page only shows whether scheduled tasks start to execute instead of whether they are successful.
      • When the task status is Pending, reassignment has not been executed.
      • When the task status is Successful, reassignment has started.
      • When the task status is Cancel, reassignment has been canceled.
    2. Click Background tasks tab page. When the task status is Successful, reassignment has completed, which means that the replicas are modified.

Modifying Replicas by Manual Reassignment

  1. Log in to the console.
  2. Click in the upper left corner to select the region where your instance is located.
  3. Click and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
  4. In the navigation pane, choose Kafka Instances.
  5. Click the desired instance to go to the instance details page.
  6. In the navigation pane, choose Topics.
  7. Go to the Manual page in either of the following ways:

    • Select a topic and choose Reassign > Manual above the topic list. Manual reassignment does not support batch operations.
    • In the row containing the desired topic, choose More > Reassign > Manual.

  8. Modify the replicas.

    • In the upper right corner of the Manual dialog box, click Delete Replica or Add Replica to reduce or increase the number of replicas for each partition of the topic.
    • Under the name of the replica to be reassigned, click the broker name or and select the target broker to migrate the replica to. Assign replicas of the same partition to different brokers.
    • Specify throttle. The default value is -1, indicating that there is no throttle. If the instance has low workload (for example, only 30/300 MB/s is used), you are not advised to limit the bandwidth. Otherwise, you are advised to set it to a value greater than or equal to the total production bandwidth of the to-be-reassigned topic multiplied by the maximum number of replicas of the to-be-reassigned topic. For details, see Calculating a Throttle.
    • For Execute, specify when to execute the reassignment. Now means to execute it immediately. As scheduled means to execute it at the scheduled time.

  9. (Optional) Click Calculate. Time Required indicates how long manual balancing will take.

    The one-click calculation function does not affect the performance of Kafka instances.

  10. Click OK.

    The following table lists how to check whether reassignment is complete (scheduled and non-scheduled tasks):

    Table 3 Checking the reassignment result

    Task Type

    Reassignment Result

    Background tasks

    In the upper left corner of the topic list, click View details and the Background Tasks > Background tasks page is displayed. The reassignment task is complete when it is in the Successful state, which means that the replicas are modified.

    Scheduled tasks

    1. The Background Tasks > Scheduled tasks page is displayed. This page only shows whether scheduled tasks start to execute instead of whether they are successful.
      • When the task status is Pending, reassignment has not been executed.
      • When the task status is Successful, reassignment has started.
      • When the task status is Cancel, reassignment has been canceled.
    2. Click Background tasks tab page. When the task status is Successful, reassignment has completed, which means that the replicas are modified.

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