When you upgrade the traffic specification of an ApsaraMQ for Kafka instance, the corresponding cluster may be scaled out. After the cluster is scaled out, you must rebalance the topic traffic to evenly distribute the traffic across brokers in the scaled-out cluster. Otherwise, the original topic traffic is still distributed across the brokers that are in the cluster before the scale-out. The original topics are subject to the maximum bandwidth purchased before the scale-out. New topics are not subject to the original maximum bandwidth.
Prerequisites
Your ApsaraMQ for Kafka instance is in the Running (Pending Rebalancing) state.
For more information about how to upgrade the traffic specification of a Message Queue for Apache Kafka instance and when a cluster scale-out is triggered, see Upgrade instance specifications.
Precautions
When your ApsaraMQ for Kafka instance is in the Running (Pending Rebalancing) state, you can use this instance to send and consume messages but cannot create resources such as topics and consumer groups in this instance.Group You must wait until the topic traffic is rebalanced or choose not to rebalance the topic traffic before you can create a resource.
Traffic rebalancing methods
Traffic rebalancing method | How it works | Impact | Suitable scenarios | Duration |
Add Partitions to All Topics | After the cluster is scaled out, the system adds partitions to the new brokers for all topics on the original brokers. |
|
| Within seconds. |
Migrate Data from Partitions of All Topics (Recommended) |
Note You can select Local Storage for Storage Engine only when you create topics for a Professional Edition instance. |
| All cluster scale-out scenarios. |
|
Do Not Rebalance (Not Recommended) | No operation is performed. The original topics are still distributed on the brokers of the cluster before the scale-out, and new topics are evenly distributed on all brokers after the scale-out. |
|
| The configuration immediately takes effect. |
Procedure
- Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, click the name of the region where your instance is deployed.
- On the Instances page, click the name of the instance that you want to manage.
In the Overview section of the Instance Details page, click Rebalance Topic Traffic in the upper-right corner.
In the Rebalance Topic Traffic for Instance panel, set the Traffic Rebalancing Method parameter. For more information about the supported traffic rebalancing methods, see Traffic rebalancing methods.
After you select a traffic rebalancing method, all topics in the instance enter the Pending Rebalancing state. You can check the topic status in the Status column on the Topics page.
Result
After the topic traffic is rebalanced, the topics enter the Running state, as shown in the Status column on the Topics page.