#!/bin/bash
SERVERS="hadoop102 hadoop103 hadoop104"
MASTER="hadoop102"
if [ $# -lt 1 ]
then
echo "No Args Input..."
exit ;
fi
case $1 in
"start")
echo "------正在启动Doris集群------"
start_fe() {
for SERVER in $SERVERS
do
if [ "$SERVER" = "$MASTER" ]; then
ssh $SERVER "/opt/module/doris/fe/bin/start_fe.sh --daemon;jps -m"
else ssh $SERVER "/opt/module/doris/fe/bin/start_fe.sh --helper $MASTER:9010 --daemon;jps -m"
fi
done
}
start_be() {
for SERVER in $SERVERS
do
ssh $SERVER "/opt/module/doris/be/bin/start_be.sh --daemon;ps -aux |grep _be"
done
}
start_broker() {
for SERVER in $SERVERS
do
ssh $SERVER "/opt/module/doris/apache_hdfs_broker/bin/start_broker.sh --daemon;jps -m"
done
}
echo "------启动FE集群------"
start_fe
echo "------启动BE集群------"
start_be
echo "------启动BROKER------"
start_broker
;;
"stop")
echo "------正在停止Doris集群------"
stop_fe() {
for SERVER in $SERVERS
do
ssh $SERVER "/opt/module/doris/fe/bin/stop_fe.sh;jps -m"
done
}
stop_be() {
for SERVER in $SERVERS
do
ssh $SERVER "/opt/module/doris/be/bin/stop_be.sh;ps -aux |grep _be"
done
}
stop_broker() {
for SERVER in $SERVERS
do
ssh $SERVER "/opt/module/doris/apache_hdfs_broker/bin/stop_broker.sh --daemon;jps -m"
done
}
echo "------停止BE集群------"
stop_be
echo "------停止FE集群------"
stop_fe
echo "------停止BROKER------"
stop_broker
;;
*)
echo "Input Args Error..."
;;
esac