We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f29c6e5 commit e4e66a7Copy full SHA for e4e66a7
start-kafka.sh
@@ -1,9 +1,14 @@
1
#!/bin/bash
2
3
-export KAFKA_ADVERTISED_PORT=$(docker port `hostname` 9092 | sed -r "s/.*:(.*)/\1/g")
4
-export KAFKA_BROKER_ID=$KAFKA_ADVERTISED_PORT
5
-export KAFKA_LOG_DIRS="\/kafka\/kafka-logs-$KAFKA_BROKER_ID"
6
-
+if [[ -z "$KAFKA_ADVERTISED_PORT" ]]; then
+ export KAFKA_ADVERTISED_PORT=$(docker port `hostname` 9092 | sed -r "s/.*:(.*)/\1/g")
+fi
+if [[ -z "$KAFKA_BROKER_ID" ]]; then
7
+ export KAFKA_BROKER_ID=$KAFKA_ADVERTISED_PORT
8
9
+if [[ -z "$KAFKA_LOG_DIRS" ]]; then
10
+ export KAFKA_LOG_DIRS="\/kafka\/kafka-logs-$KAFKA_BROKER_ID"
11
12
if [[ -z "$KAFKA_ZOOKEEPER_CONNECT" ]]; then
13
export KAFKA_ZOOKEEPER_CONNECT=$(env | grep ZK.*PORT_2181_TCP= | sed -e 's|.*tcp://||' | paste -sd ,)
14
fi
0 commit comments