集群群起脚本
作者:互联网
以Kafka为例
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Input Args Error....."
exit
fi
for i in hadoop102 hadoop103 hadoop104
do
case $1 in
start)
echo "==================START $i KAFKA==================="
#如需启动其他集群,修改此处即可
ssh $i /opt/module/kafka_2.11-2.4.1/bin/kafka-server-start.sh -daemon /opt/module/kafka_2.11-2.4.1/config/server.properties
;;
stop)
echo "==================STOP $i KAFKA==================="
#如需关闭其他集群,修改此处即可
ssh $i /opt/module/kafka_2.11-2.4.1/bin/kafka-server-stop.sh stop
;;
*)
echo "Input Args Error....."
exit
;;
esac
done
标签:脚本,opt,module,echo,集群,群起,kafka,2.11,2.4 来源: https://www.cnblogs.com/traveller-hzq/p/14103774.html