Last active
April 5, 2018 22:48
-
-
Save lenadroid/656ed280808b7221f9601b662a5edd7c to your computer and use it in GitHub Desktop.
Script to run to get Kafka and Zookeeper node hostnames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set cluster variables | |
export KAFKA_USERNAME="..." | |
export KAFKA_PASSWORD="..." | |
export KAFKA_CLUSTERNAME="..." | |
# Get Kafka broker hostnames | |
export KAFKA_BROKERS=$(curl -u $KAFKA_USERNAME:$KAFKA_PASSWORD -G "https://$KAFKA_CLUSTERNAME.azurehdinsight.net/api/v1/clusters/$KAFKA_CLUSTERNAME/services/KAFKA/components/KAFKA_BROKER" | jq -r '["\(.host_components[].HostRoles.host_name):9092"] | join(",")') | |
echo $KAFKA_BROKERS | |
# Get Zookeeper node hostnames | |
export ZK_NODES=$(curl -u $KAFKA_USERNAME:$KAFKA_PASSWORD -G "https://$KAFKA_CLUSTERNAME.azurehdinsight.net/api/v1/clusters/$KAFKA_CLUSTERNAME/services/ZOOKEEPER/components/ZOOKEEPER_SERVER" | jq -r '["\(.host_components[].HostRoles.host_name):2181"] | join(",")') | |
echo $ZK_NODES |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment