kafka 集群启动脚本

#!/bin/bash

case $1 in
"start"){
     

for i in xmaster xslave1 xslave2

do 
    echo "------------$i kafka start----------------"
    ssh $i "source /etc/profile;/home/software/kafka_2.12-2.5.0/bin/kafka-server-start.sh -daemon /home/software/kafka_2.12-2.5.0/config/server.properties"
   
done

};;

"stop"){
     

for i in xmaster xslave1 xslave2

do 
   echo "------------$i kafka end---------------"
   ssh $i "source /etc/profile;/home/software/kafka_2.12-2.5.0/bin/kafka-server-stop.sh stop"

done
};;
esac

你可能感兴趣的:(kafka,shell,kafka)