Created
June 26, 2017 16:03
-
-
Save dimitraz/9d628978794fee024a5e3c3711cef1d0 to your computer and use it in GitHub Desktop.
Kafka bootstrap servers
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
CONTAINER_PORT="9092" | |
else | |
CONTAINER_PORT=$1 | |
fi | |
# Get the Kafka container IP | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
CONTAINER_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' kafka) | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka) | |
sudo ifconfig lo0 alias $CONTAINER_IP | |
fi | |
# Create the config file | |
echo $CONTAINER_IP:$CONTAINER_PORT > server.properties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment