Managed Service for Apache Kafka automatically provisions the brokers for a cluster. A broker has the following properties:
brokerIndex: The zero-based index of the broker.nodeId: The node ID for the broker.rack: The zone where the broker is provisioned, for exampleus-central1-a.
To view the brokers for a cluster, perform the following steps.
Console
Go to the Managed Service for Apache Kafka > Clusters page.
Click the name of the cluster.
Select the Configurations tab. The cluster's brokers are listed under Active Brokers.
gcloud
To get a list of the cluster's brokers, use the
managed-kafka clusters describe
command with the --full flag.
gcloud managed-kafka clusters describe CLUSTER_ID \
--location=LOCATION \
--full \
--format="yaml(brokerDetails)"
Replace the following:
- CLUSTER_ID: The ID or name of the cluster.
- LOCATION: The location of the cluster.
The output looks similar to the following:
brokerDetails:
- brokerIndex: '0'
nodeId: '10'
rack: us-central1-c
- brokerIndex: '1'
nodeId: '11'
rack: us-central1-f
- brokerIndex: '2'
nodeId: '12'
rack: us-central1-b
Kafka CLI
Before running this command, install the Kafka command-line tools on a Compute Engine VM. The VM must be able to reach a subnet that is connected to your Managed Service for Apache Kafka cluster. Follow the instructions in Produce and consume messages with the Kafka command-line tools.
To get a list of the cluster's brokers, use the kafka-configs.sh --describe
command with the --entity-type=brokers flag.
kafka-configs.sh --describe --entity-type brokers \
--bootstrap-server=BOOTSTRAP_ADDRESS \
--command-config client.properties
Replace BOOTSTRAP_ADDRESS with the cluster's bootstrap address.
This command returns a list of broker IDs, along with their dynamic
configuration settings, if any. It does not return the rack property.
What's next
- Overview of brokers in Managed Service for Apache Kafka
- Broker provisioning
- View a Managed Service for Apache Kafka cluster