Skip to content

Commit 4fa870d

Browse files
committedApr 23, 2015
modified KAFKA_CREATE_TOPICS syntax
Replaced `name1,partitions,replicas:name2,partitions,replicas` with `name1:partitions:replicas,name2:partitions:replicas`.
1 parent bed7b77 commit 4fa870d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ added in ```docker-compose.yml```.
4545
Here is an example snippet from ```docker-compose.yml```:
4646

4747
environment:
48-
KAFKA_CREATE_TOPICS: "Topic1,1,3:Topic2,1,1"
48+
KAFKA_CREATE_TOPICS: "Topic1:1:3,Topic2:1:1"
4949

5050
```Topic 1``` will have 1 partition and 3 replicas, ```Topic 2``` will have 1 partition and 1 replica.
5151

52-
NOTE: All topics will be created with a single partition and a single replica
53-
5452
##Tutorial
5553

5654
[http://wurstmeister.github.io/kafka-docker/](http://wurstmeister.github.io/kafka-docker/)

‎start-kafka.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ KAFKA_SERVER_PID=$!
3838
while netstat -lnt | awk '$4 ~ /:9092$/ {exit 1}'; do sleep 1; done
3939

4040
if [[ -n $KAFKA_CREATE_TOPICS ]]; then
41-
IFS=':'; for topicToCreate in $KAFKA_CREATE_TOPICS; do
42-
IFS=',' read -a topicConfig <<< "$topicToCreate"
41+
IFS=','; for topicToCreate in $KAFKA_CREATE_TOPICS; do
42+
IFS=':' read -a topicConfig <<< "$topicToCreate"
4343
$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $KAFKA_ZOOKEEPER_CONNECT --replication-factor ${topicConfig[2]} --partition ${topicConfig[1]} --topic "${topicConfig[0]}"
4444
done
4545
fi

0 commit comments

Comments
 (0)