未验证 提交 908dba4b 编写于 作者: Z zhuangchong 提交者: GitHub

[Improvement][install,start-all,stop-all] start- all.sh and stop- all.sh After...

[Improvement][install,start-all,stop-all] start- all.sh and stop- all.sh After execution, you can view the running status of each node and service. #3619 (#3627)

* start- all.sh and stop- all.sh After execution, you can view the running status of each node and service.

* ds server state check.
上级 bc766aaa
......@@ -98,7 +98,3 @@ sh ${workDir}/script/remove-zk-node.sh $zkRoot
# 6.startup
echo "6.startup"
sh ${workDir}/script/start-all.sh
# 7.query status
echo "7.query status"
sh ${workDir}/script/status-all.sh
......@@ -16,7 +16,7 @@
# limitations under the License.
#
usage="Usage: dolphinscheduler-daemon.sh (start|stop) <command> "
usage="Usage: dolphinscheduler-daemon.sh (start|stop|status) <command> "
# if no args specified, show usage
if [ $# -le 1 ]; then
......@@ -29,7 +29,6 @@ shift
command=$1
shift
echo "Begin $startStop $command......"
BIN_DIR=`dirname $0`
BIN_DIR=`cd "$BIN_DIR"; pwd`
......@@ -122,11 +121,23 @@ case $startStop in
fi
;;
(status)
# more details about the status can be added later
serverCount=`ps -ef |grep "$CLASS" |grep -v "grep" |wc -l`
state="STOP"
# font color - red
state="[ \033[1;31m $state \033[0m ]"
if [[ $serverCount -gt 0 ]];then
state="RUNNING"
# font color - green
state="[ \033[1;32m $state \033[0m ]"
fi
echo -e "$command $state"
;;
(*)
echo $usage
exit 1
;;
esac
echo "End $startStop $command."
......@@ -54,4 +54,8 @@ for apiServer in ${apiServersHost[@]}
do
echo "$apiServer worker server is starting"
ssh -p $sshPort $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start api-server;"
done
\ No newline at end of file
done
# query server status
echo "query server status"
cd $installPath/; sh bin/status-all.sh
......@@ -20,22 +20,59 @@ workDir=`dirname $0`
workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/install_config.conf
# install_config.conf info
echo -e '\n'
echo "====================== dolphinscheduler install config============================="
echo -e "1.dolphinscheduler server node install hosts:[ \033[1;32m ${ips} \033[0m ]"
echo -e "2.master server node install hosts:[ \033[1;32m ${masters} \033[0m ]"
echo -e "3.worker server node install hosts:[ \033[1;32m ${workers} \033[0m ]"
echo -e "4.alert server node install hosts:[ \033[1;32m ${alertServer} \033[0m ]"
echo -e "5.api server node install hosts:[ \033[1;32m ${apiServers} \033[0m ]"
echo "====================== dolphinscheduler server config ============================="
echo -e "1.dolphinscheduler server node config hosts:[ \033[1;32m ${ips} \033[0m ]"
echo -e "2.master server node config hosts:[ \033[1;32m ${masters} \033[0m ]"
echo -e "3.worker server node config hosts:[ \033[1;32m ${workers} \033[0m ]"
echo -e "4.alert server node config hosts:[ \033[1;32m ${alertServer} \033[0m ]"
echo -e "5.api server node config hosts:[ \033[1;32m ${apiServers} \033[0m ]"
# all server check state
echo -e '\n'
echo "====================== dolphinscheduler server status ============================="
firstColumn="node server state"
echo $firstColumn
echo -e '\n'
declare -A workersGroupMap=()
workersGroup=(${workers//,/ })
for workerGroup in ${workersGroup[@]}
do
worker=`echo $workerGroup|awk -F':' '{print $1}'`
groupName=`echo $workerGroup|awk -F':' '{print $2}'`
workersGroupMap+=([$worker]=$groupName)
done
ipsHost=(${ips//,/ })
for ip in ${ipsHost[@]}
StateRunning="Running"
# 1.master server check state
mastersHost=(${masters//,/ })
for master in ${mastersHost[@]}
do
echo -e "====================== [ \033[1;32m ${ip} \033[0m ] node all servers =========================="
ssh -p $sshPort $ip "jps"
echo -e '\n'
masterState=`ssh -p $sshPort $master "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status master-server;"`
echo "$master $masterState"
done
# 2.worker server and logger-server check state
for worker in ${!workersGroupMap[*]}
do
workerState=`ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status worker-server;"`
echo "$worker $workerState"
masterState=`ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status logger-server;"`
echo "$worker $masterState"
done
# 3.alter server check state
alertState=`ssh -p $sshPort $alertServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status alert-server;"`
echo "$alertServer $alertState"
# 4.api server check state
apiServersHost=(${apiServers//,/ })
for apiServer in ${apiServersHost[@]}
do
apiState=`ssh -p $sshPort $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status api-server;"`
echo "$apiServer $apiState"
done
......@@ -54,4 +54,8 @@ for apiServer in ${apiServersHost[@]}
do
echo "$apiServer worker server is stopping"
ssh -p $sshPort $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop api-server;"
done
\ No newline at end of file
done
# query server status
echo "query server status"
cd $installPath/; sh bin/status-all.sh
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册