Kafka 集群群起/关闭脚本
vi kafka.sh
#!/bin/bash case $1 in "start"){ for i in hadoop01 hadoop02 hadoop03 do echo "================ $i ================" ssh $i "${KAFKA_HOME}/bin/kafka-server-start.sh -daemon ${KAFKA_HOME}/config/server.properties" done };; "stop"){ for i in hadoop01 hadoop02 hadoop03 do echo "================ $i ================" ssh $i "${KAFKA_HOME}/bin/kafka-server-stop.sh" done };; esac
进入目录:
./kafka.sh start/stop