StarRocks启动和停止和重启脚本
编辑脚本:vim start_stop_starrocks.sh
备注:IP修改为自己的IP即可
#!/bin/bash
case $1 in
"start"){
for i in 12.3.7.147 12.3.7.148 12.3.7.149 12.3.7.150
do
echo " --------启动 $i be -------"
ssh $i "/home/hadoop/StarRocks-2.4.1/be/bin/start_be.sh --daemon"
done
};;
"stop"){
for i in 12.3.7.147 12.3.7.148 12.3.7.149 12.3.7.150
do
echo " --------停止 $i be -------"
ssh $i "/home/hadoop/StarRocks-2.4.1/be/bin/stop_be.sh --daemon"
done
};;
"restart"){
for i in 12.3.7.147 12.3.7.148 12.3.7.149 12.3.7.150
do
echo " --------停止 $i be -------"
ssh $i "/home/hadoop/StarRocks-2.4.1/be/bin/stop_be.sh --daemon"
done
sleep 5
for i in 12.3.7.147 12.3.7.148 12.3.7.149 12.3.7.150
do
echo " --------启动 $i be -------"
ssh $i "/home/hadoop/StarRocks-2.4.1/be/bin/start_be.sh --daemon"
done
};;
esac
执行命令
启动集群
sh start_stop_starrocks.sh start
停止集群
sh start_stop_starrocks.sh stop
重启集群
sh start_stop_starrocks.sh restart