Expand the number of brokers in an Amazon MSK cluster
Use this Amazon MSK operation when you want to increase the number of brokers in your
MSK cluster. To expand a cluster, make sure that it is in the
ACTIVE state.
Important
If you want to expand an MSK cluster, make sure to use this Amazon MSK operation. Don't try to add brokers to a cluster without using this operation.
For information about how to rebalance partitions after you add brokers to a cluster, see Reassign partitions.
Expand a Amazon MSK cluster using the Amazon Web Services Management Console
This process describes how to increase the number of brokers in an Amazon MSK cluster using the Amazon Web Services Management Console.
Sign in to the Amazon Web Services Management Console, and open the Amazon MSK console at https://console.amazonaws.cn/msk/home?region=us-east-1#/home/
. -
Choose the MSK cluster whose number of brokers you want to increase.
-
From the Actions dropdown, choose Edit number of brokers.
-
Enter the number of brokers that you want the cluster to have per Availability Zone and then choose Save changes.
Expand a Amazon MSK cluster using the Amazon CLI
This process describes how to increase the number of brokers in an Amazon MSK cluster using the Amazon CLI.
-
Run the following command, replacing
ClusterArnwith the Amazon Resource Name (ARN) that you obtained when you created your cluster. If you don't have the ARN for your cluster, you can find it by listing all clusters. For more information, see List Amazon MSK clusters.Replace
Current-Cluster-Versionwith the current version of the cluster.Important
Cluster versions aren't simple integers. To find the current version of the cluster, use the DescribeCluster
operation or the describe-cluster Amazon CLI command. An example version is KTVPDKIKX0DER.The
Target-Number-of-Brokersparameter represents the total number of broker nodes that you want the cluster to have when this operation completes successfully. The value you specify forTarget-Number-of-Brokersmust be a whole number that is greater than the current number of brokers in the cluster. It must also be a multiple of the number of Availability Zones.aws kafka update-broker-count --cluster-arnClusterArn--current-versionCurrent-Cluster-Version--target-number-of-broker-nodesTarget-Number-of-BrokersThe output of this
update-broker-countoperation looks like the following JSON.{ "ClusterArn": "arn:aws:kafka:us-east-1:012345678012:cluster/exampleClusterName/abcdefab-1234-abcd-5678-cdef0123ab01-2", "ClusterOperationArn": "arn:aws:kafka:us-east-1:012345678012:cluster-operation/exampleClusterName/abcdefab-1234-abcd-5678-cdef0123ab01-2/0123abcd-abcd-4f7f-1234-9876543210ef" } -
To get the result of the
update-broker-countoperation, run the following command, replacingClusterOperationArnwith the ARN that you obtained in the output of theupdate-broker-countcommand.aws kafka describe-cluster-operation --cluster-operation-arnClusterOperationArnThe output of this
describe-cluster-operationcommand looks like the following JSON example.{ "ClusterOperationInfo": { "ClientRequestId": "c0b7af47-8591-45b5-9c0c-909a1a2c99ea", "ClusterArn": "arn:aws:kafka:us-east-1:012345678012:cluster/exampleClusterName/abcdefab-1234-abcd-5678-cdef0123ab01-2", "CreationTime": "2019-09-25T23:48:04.794Z", "OperationArn": "arn:aws:kafka:us-east-1:012345678012:cluster-operation/exampleClusterName/abcdefab-1234-abcd-5678-cdef0123ab01-2/0123abcd-abcd-4f7f-1234-9876543210ef", "OperationState": "UPDATE_COMPLETE", "OperationType": "INCREASE_BROKER_COUNT", "SourceClusterInfo": { "NumberOfBrokerNodes": 9 }, "TargetClusterInfo": { "NumberOfBrokerNodes": 12 } } }In this output,
OperationTypeisINCREASE_BROKER_COUNT. IfOperationStatehas the valueUPDATE_IN_PROGRESS, wait a while, then run thedescribe-cluster-operationcommand again.
Expand a Amazon MSK cluster using the API
To increase the number of brokers in a cluster using the API, see UpdateBrokerCount.