Getting the bootstrap brokers for an Amazon MSK Cluster - Amazon Managed Streaming for Apache Kafka

Getting the bootstrap brokers for an Amazon MSK Cluster

Getting the bootstrap brokers using the AWS Management Console

The term bootstrap brokers refers to a list of brokers that an Apache Kafka client can use as a starting point to connect to the cluster. This list doesn't necessarily include all of the brokers in a cluster.

  1. Open the Amazon MSK console at https://console.aws.amazon.com/msk/.

  2. The table shows all the clusters for the current region under this account. Choose the name of a cluster to view its description.

  3. On the Cluster summary page, choose View client information. This shows you the bootstrap brokers, as well as the Apache ZooKeeper connection string.

Getting the bootstrap brokers using the AWS CLI

Run the following command, replacing ClusterArn with 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 Listing Amazon MSK clusters.

aws kafka get-bootstrap-brokers --cluster-arn ClusterArn

For an MSK cluster that uses IAM access control, the output of this command looks like the following JSON example.

{ "BootstrapBrokerStringSaslIam": "b-1.myTestCluster.123z8u.c2.kafka.us-west-1.amazonaws.com:9098,b-2.myTestCluster.123z8u.c2.kafka.us-west-1.amazonaws.com:9098" }

The number of bootstrap brokers in the string is equal to the number of zones in which your MSK cluster is deployed.

Getting the bootstrap brokers using the API

To get the bootstrap brokers using the API, see GetBootstrapBrokers.