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

 

posted @ 2020-11-20 14:35  smandar  阅读(250)  评论(0编辑  收藏  举报