Skip to content

Commit 89e1751

Browse files
Update apache-kafka-producer-consumer-api.md
1 parent 5ba379c commit 89e1751

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

articles/hdinsight/kafka/apache-kafka-producer-consumer-api.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,18 @@ The [Run.java](https://github.com/Azure-Samples/hdinsight-kafka-java-get-started
153153
```bash
154154
export clusterName=$(curl -u admin:$password -sS -G "http://headnodehost:8080/api/v1/clusters" | jq -r '.items[].Clusters.cluster_name')
155155
```
156+
> [!Note]
157+
> If you're running this command from outside the cluster, get the cluster name from the Azure portal. Enter clusterName in lowercase and run the command `export clusterName='clustername'` to store the variable.
156158
157159
1. To get the Kafka broker hosts, use the following command:
158160
159161
```bash
160-
export KAFKABROKERS=`curl -sS -u admin:$password -G http://headnodehost:8080/api/v1/clusters/$clusterName/services/KAFKA/components/KAFKA_BROKER | jq -r '["\(.host_components[].HostRoles.host_name):9092"] | join(",")' | cut -d',' -f1,2`
162+
export KAFKABROKERS=$(curl -sS -u admin:$password -G https://$clusterName.azurehdinsight.net/api/v1/clusters/$clusterName/services/KAFKA/components/KAFKA_BROKER | jq -r '["\(.host_components[].HostRoles.host_name):9092"] | join(",")' | cut -d',' -f1,2);
161163
```
162164
165+
> [!Note]
166+
> This command requires Ambari access. If your cluster is behind an NSG, run this command from a machine that can access Ambari.
167+
163168
1. Create Kafka topic, `myTest`, by entering the following command:
164169
165170
```bash

0 commit comments

Comments
 (0)