Browse Source

fix status check issue (#11580)

3.1.0-release
Yann Ann 2 years ago committed by GitHub
parent
commit
d5a984748d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      script/dolphinscheduler-daemon.sh
  2. 8
      script/status-all.sh

4
script/dolphinscheduler-daemon.sh

@ -28,6 +28,8 @@ startStop=$1
shift shift
command=$1 command=$1
shift shift
CLASS=$1
shift
echo "Begin $startStop $command......" echo "Begin $startStop $command......"
@ -109,7 +111,7 @@ case $startStop in
(status) (status)
# more details about the status can be added later # more details about the status can be added later
serverCount=`ps -ef | grep "$DOLPHINSCHEDULER_HOME" | grep "$CLASS" | grep -v "grep" | wc -l` serverCount=`ps -ef | grep "java" | grep "$DOLPHINSCHEDULER_HOME" | grep "$CLASS" | grep -v "grep" | wc -l`
state="STOP" state="STOP"
# font color - red # font color - red
state="[ \033[1;31m $state \033[0m ]" state="[ \033[1;31m $state \033[0m ]"

8
script/status-all.sh

@ -49,25 +49,25 @@ StateRunning="Running"
mastersHost=(${masters//,/ }) mastersHost=(${masters//,/ })
for master in ${mastersHost[@]} for master in ${mastersHost[@]}
do do
masterState=`ssh -o StrictHostKeyChecking=no -p $sshPort $master "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status master-server;"` masterState=`ssh -o StrictHostKeyChecking=no -p $sshPort $master "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status master-server org.apache.dolphinscheduler.server.master.MasterServer;"`
echo "$master $masterState" echo "$master $masterState"
done done
# 2.worker server check state # 2.worker server check state
for worker in ${workerNames[@]} for worker in ${workerNames[@]}
do do
workerState=`ssh -o StrictHostKeyChecking=no -p $sshPort $worker "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status worker-server;"` workerState=`ssh -o StrictHostKeyChecking=no -p $sshPort $worker "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status worker-server org.apache.dolphinscheduler.server.worker.WorkerServer;"`
echo "$worker $workerState" echo "$worker $workerState"
done done
# 3.alter server check state # 3.alter server check state
alertState=`ssh -o StrictHostKeyChecking=no -p $sshPort $alertServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status alert-server;"` alertState=`ssh -o StrictHostKeyChecking=no -p $sshPort $alertServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status alert-server org.apache.dolphinscheduler.alert.AlertServer;"`
echo "$alertServer $alertState" echo "$alertServer $alertState"
# 4.api server check state # 4.api server check state
apiServersHost=(${apiServers//,/ }) apiServersHost=(${apiServers//,/ })
for apiServer in ${apiServersHost[@]} for apiServer in ${apiServersHost[@]}
do do
apiState=`ssh -o StrictHostKeyChecking=no -p $sshPort $apiServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status api-server;"` apiState=`ssh -o StrictHostKeyChecking=no -p $sshPort $apiServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status api-server org.apache.dolphinscheduler.api.ApiApplicationServer;"`
echo "$apiServer $apiState" echo "$apiServer $apiState"
done done

Loading…
Cancel
Save