From d5a984748d0be34c720f966ea9fcdb5719aca934 Mon Sep 17 00:00:00 2001 From: Yann Ann Date: Sun, 21 Aug 2022 23:04:12 +0800 Subject: [PATCH] fix status check issue (#11580) --- script/dolphinscheduler-daemon.sh | 4 +++- script/status-all.sh | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/script/dolphinscheduler-daemon.sh b/script/dolphinscheduler-daemon.sh index 9e34ee5737..5839615efc 100755 --- a/script/dolphinscheduler-daemon.sh +++ b/script/dolphinscheduler-daemon.sh @@ -28,6 +28,8 @@ startStop=$1 shift command=$1 shift +CLASS=$1 +shift echo "Begin $startStop $command......" @@ -109,7 +111,7 @@ case $startStop in (status) # 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" # font color - red state="[ \033[1;31m $state \033[0m ]" diff --git a/script/status-all.sh b/script/status-all.sh index 9e622633f7..062de851e8 100755 --- a/script/status-all.sh +++ b/script/status-all.sh @@ -49,25 +49,25 @@ StateRunning="Running" mastersHost=(${masters//,/ }) for master in ${mastersHost[@]} 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" done # 2.worker server check state for worker in ${workerNames[@]} 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" done # 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" # 4.api server check state apiServersHost=(${apiServers//,/ }) for apiServer in ${apiServersHost[@]} 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" done