Преглед на файлове

Instead of sleeping, poll for the socket to be ready

Hopefully this fixes the heisenbug where we try to set up the topics before the
cluster has actually booted.
Evan Huus преди 11 години
родител
ревизия
bfef474645
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      vagrant/create_topics.sh

+ 2 - 1
vagrant/create_topics.sh

@@ -2,7 +2,8 @@
 
 
 set -ex
 set -ex
 
 
-sleep 10
+while ! nc -q 1 localhost 21801 </dev/null; do echo "Waiting"; sleep 1; done
+while ! nc -q 1 localhost 29092 </dev/null; do echo "Waiting"; sleep 1; done
 
 
 cd ${KAFKA_INSTALL_ROOT}/kafka-9092
 cd ${KAFKA_INSTALL_ROOT}/kafka-9092
 bin/kafka-topics.sh --create --partitions 1 --replication-factor 3 --topic single_partition --zookeeper localhost:2181
 bin/kafka-topics.sh --create --partitions 1 --replication-factor 3 --topic single_partition --zookeeper localhost:2181