kafka通过脚本一次启动集群

x33g5p2x  于2021-12-19 转载在 其他  
字(0.5k)|赞(0)|评价(0)|浏览(514)

kafka 群起脚本kafka.sh

#!/bin/bash

case $1 in "start"){
  for i in backup01 backup02 backup03
      do 
        echo "========== $i =========="  
        ssh $i '/usr/local/hadoop/kafka/kafka_2.12-2.4.1/bin/kafka-server-start.sh 
        -daemon /usr/local/hadoop/kafka/kafka_2.12-2.4.1/binconfig/server.properties' 

      done
};;
"stop"){
  for i in backup01 backup02 backup03
      do 
         echo "========== $i =========="  
         ssh $i '/usr/local/hadoop/kafka/kafka_2.12-2.4.1/bin/kafka-server-stop.sh' 
      done
};;

esac

相关文章