halt_cluster.sh 692 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # If the functional tests failed (or some other task) then
  3. # we might want to look into the broker logs
  4. if [ "$TRAVIS_TEST_RESULT" = "1" ]; then
  5. echo "Dumping Kafka brokers server.log:"
  6. for i in 1 2 3 4 5; do
  7. KAFKA_PORT=`expr $i + 9090`
  8. sed -e "s/^/kafka-${KAFKA_PORT} /" ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT}/logs/server.log{.*,}
  9. done
  10. fi
  11. set -ex
  12. for i in 1 2 3 4 5; do
  13. KAFKA_PORT=`expr $i + 9090`
  14. cd ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT} && bin/kafka-server-stop.sh
  15. done
  16. for i in 1 2 3 4 5; do
  17. KAFKA_PORT=`expr $i + 9090`
  18. cd ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT} && bin/zookeeper-server-stop.sh
  19. done
  20. killall toxiproxy