boot_cluster.sh 815 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. set -ex
  3. # Launch and wait for toxiproxy
  4. ${REPOSITORY_ROOT}/vagrant/run_toxiproxy.sh &
  5. while ! nc -q 1 localhost 2181 </dev/null; do echo "Waiting"; sleep 1; done
  6. while ! nc -q 1 localhost 9092 </dev/null; do echo "Waiting"; sleep 1; done
  7. # Launch and wait for Zookeeper
  8. for i in 1 2 3 4 5; do
  9. KAFKA_PORT=`expr $i + 9090`
  10. cd ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT} && bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
  11. done
  12. while ! nc -q 1 localhost 21805 </dev/null; do echo "Waiting"; sleep 1; done
  13. # Launch and wait for Kafka
  14. for i in 1 2 3 4 5; do
  15. KAFKA_PORT=`expr $i + 9090`
  16. cd ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT} && bin/kafka-server-start.sh -daemon config/server.properties
  17. done
  18. while ! nc -q 1 localhost 29095 </dev/null; do echo "Waiting"; sleep 1; done