[Bug] [Dev] Fix start/stop/status/init script error (#9514)
* change /bin/sh to /bin/bash * change /bin/sh to /bin/bash * remove declear -A to adapt mac
This commit is contained in:
parent
adcc43fd7e
commit
ec939fcc68
|
|
@ -52,7 +52,7 @@
|
||||||
<includes>
|
<includes>
|
||||||
<include>sql/**/*</include>
|
<include>sql/**/*</include>
|
||||||
</includes>
|
</includes>
|
||||||
<outputDirectory>conf</outputDirectory>
|
<outputDirectory>sql</outputDirectory>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>${basedir}/../dolphinscheduler-common/src/main/resources</directory>
|
<directory>${basedir}/../dolphinscheduler-common/src/main/resources</directory>
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,12 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
BIN_DIR=$(dirname $0)
|
BIN_DIR=$(dirname $0)
|
||||||
DOLPHINSCHEDULER_HOME=${DOLPHINSCHEDULER_HOME:-$(cd $BIN_DIR/..; pwd)}
|
DOLPHINSCHEDULER_HOME=${DOLPHINSCHEDULER_HOME:-$(cd $BIN_DIR/../..; pwd)}
|
||||||
|
|
||||||
source "$BIN_DIR/dolphinscheduler_env.sh"
|
source "$DOLPHINSCHEDULER_HOME/bin/env/dolphinscheduler_env.sh"
|
||||||
|
|
||||||
|
JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}
|
||||||
|
|
||||||
java $JAVA_OPTS \
|
java $JAVA_OPTS \
|
||||||
-cp "$DOLPHINSCHEDULER_HOME/conf":"$DOLPHINSCHEDULER_HOME/libs/*" \
|
-cp "$DOLPHINSCHEDULER_HOME/conf":"$DOLPHINSCHEDULER_HOME/tools/libs/*":"$DOLPHINSCHEDULER_HOME/tools/sql" \
|
||||||
org.apache.dolphinscheduler.tools.datasource.CreateDolphinScheduler
|
org.apache.dolphinscheduler.tools.datasource.CreateDolphinScheduler
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,12 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
BIN_DIR=$(dirname $0)
|
BIN_DIR=$(dirname $0)
|
||||||
DOLPHINSCHEDULER_HOME=${DOLPHINSCHEDULER_HOME:-$(cd $BIN_DIR/..; pwd)}
|
DOLPHINSCHEDULER_HOME=${DOLPHINSCHEDULER_HOME:-$(cd $BIN_DIR/../..; pwd)}
|
||||||
|
|
||||||
source "$BIN_DIR/dolphinscheduler_env.sh"
|
source "$DOLPHINSCHEDULER_HOME/bin/env/dolphinscheduler_env.sh"
|
||||||
|
|
||||||
|
JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}
|
||||||
|
|
||||||
java $JAVA_OPTS \
|
java $JAVA_OPTS \
|
||||||
-cp "$DOLPHINSCHEDULER_HOME/conf":"$DOLPHINSCHEDULER_HOME/libs/*" \
|
-cp "$DOLPHINSCHEDULER_HOME/conf":"$DOLPHINSCHEDULER_HOME/tools/libs/*":"$DOLPHINSCHEDULER_HOME/tools/sql" \
|
||||||
org.apache.dolphinscheduler.tools.datasource.UpgradeDolphinScheduler
|
org.apache.dolphinscheduler.tools.datasource.UpgradeDolphinScheduler
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
@ -69,7 +69,7 @@ fi
|
||||||
case $startStop in
|
case $startStop in
|
||||||
(start)
|
(start)
|
||||||
echo starting $command, logging to $DOLPHINSCHEDULER_LOG_DIR
|
echo starting $command, logging to $DOLPHINSCHEDULER_LOG_DIR
|
||||||
nohup /bin/sh "$DOLPHINSCHEDULER_HOME/$command/bin/start.sh" > $log 2>&1 &
|
nohup /bin/bash "$DOLPHINSCHEDULER_HOME/$command/bin/start.sh" > $log 2>&1 &
|
||||||
echo $! > $pid
|
echo $! > $pid
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
@ -30,7 +30,7 @@ if [ ! -d $installPath ];then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "2.scp resources"
|
echo "2.scp resources"
|
||||||
sh ${workDir}/scp-hosts.sh
|
bash ${workDir}/scp-hosts.sh
|
||||||
if [ $? -eq 0 ];then
|
if [ $? -eq 0 ];then
|
||||||
echo 'scp copy completed'
|
echo 'scp copy completed'
|
||||||
else
|
else
|
||||||
|
|
@ -39,10 +39,10 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "3.stop server"
|
echo "3.stop server"
|
||||||
sh ${workDir}/stop-all.sh
|
bash ${workDir}/stop-all.sh
|
||||||
|
|
||||||
echo "4.delete zk node"
|
echo "4.delete zk node"
|
||||||
sh ${workDir}/remove-zk-node.sh $zkRoot
|
bash ${workDir}/remove-zk-node.sh $zkRoot
|
||||||
|
|
||||||
echo "5.startup"
|
echo "5.startup"
|
||||||
sh ${workDir}/start-all.sh
|
bash ${workDir}/start-all.sh
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
@ -27,8 +27,6 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
txt="''"
|
txt="''"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -A workersGroupMap=()
|
|
||||||
|
|
||||||
workersGroup=(${workers//,/ })
|
workersGroup=(${workers//,/ })
|
||||||
for workerGroup in ${workersGroup[@]}
|
for workerGroup in ${workersGroup[@]}
|
||||||
do
|
do
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
@ -21,8 +21,6 @@ workDir=`cd ${workDir};pwd`
|
||||||
|
|
||||||
source ${workDir}/env/install_env.sh
|
source ${workDir}/env/install_env.sh
|
||||||
|
|
||||||
declare -A workersGroupMap=()
|
|
||||||
|
|
||||||
workersGroup=(${workers//,/ })
|
workersGroup=(${workers//,/ })
|
||||||
for workerGroup in ${workersGroup[@]}
|
for workerGroup in ${workersGroup[@]}
|
||||||
do
|
do
|
||||||
|
|
@ -36,7 +34,7 @@ mastersHost=(${masters//,/ })
|
||||||
for master in ${mastersHost[@]}
|
for master in ${mastersHost[@]}
|
||||||
do
|
do
|
||||||
echo "$master master server is starting"
|
echo "$master master server is starting"
|
||||||
ssh -p $sshPort $master "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start master-server;"
|
ssh -p $sshPort $master "cd $installPath/; bash bin/dolphinscheduler-daemon.sh start master-server;"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -44,18 +42,18 @@ for worker in ${!workersGroupMap[*]}
|
||||||
do
|
do
|
||||||
echo "$worker worker server is starting"
|
echo "$worker worker server is starting"
|
||||||
|
|
||||||
ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start worker-server;"
|
ssh -p $sshPort $worker "cd $installPath/; bash bin/dolphinscheduler-daemon.sh start worker-server;"
|
||||||
done
|
done
|
||||||
|
|
||||||
ssh -p $sshPort $alertServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start alert-server;"
|
ssh -p $sshPort $alertServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh start alert-server;"
|
||||||
|
|
||||||
apiServersHost=(${apiServers//,/ })
|
apiServersHost=(${apiServers//,/ })
|
||||||
for apiServer in ${apiServersHost[@]}
|
for apiServer in ${apiServersHost[@]}
|
||||||
do
|
do
|
||||||
echo "$apiServer api server is starting"
|
echo "$apiServer api server is starting"
|
||||||
ssh -p $sshPort $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start api-server;"
|
ssh -p $sshPort $apiServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh start api-server;"
|
||||||
done
|
done
|
||||||
|
|
||||||
# query server status
|
# query server status
|
||||||
echo "query server status"
|
echo "query server status"
|
||||||
cd $installPath/; sh bin/status-all.sh
|
cd $installPath/; bash bin/status-all.sh
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
@ -37,8 +37,6 @@ firstColumn="node server state"
|
||||||
echo $firstColumn
|
echo $firstColumn
|
||||||
echo -e '\n'
|
echo -e '\n'
|
||||||
|
|
||||||
declare -A workersGroupMap=()
|
|
||||||
|
|
||||||
workersGroup=(${workers//,/ })
|
workersGroup=(${workers//,/ })
|
||||||
for workerGroup in ${workersGroup[@]}
|
for workerGroup in ${workersGroup[@]}
|
||||||
do
|
do
|
||||||
|
|
@ -52,25 +50,25 @@ StateRunning="Running"
|
||||||
mastersHost=(${masters//,/ })
|
mastersHost=(${masters//,/ })
|
||||||
for master in ${mastersHost[@]}
|
for master in ${mastersHost[@]}
|
||||||
do
|
do
|
||||||
masterState=`ssh -p $sshPort $master "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status master-server;"`
|
masterState=`ssh -p $sshPort $master "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status master-server;"`
|
||||||
echo "$master $masterState"
|
echo "$master $masterState"
|
||||||
done
|
done
|
||||||
|
|
||||||
# 2.worker server check state
|
# 2.worker server check state
|
||||||
for worker in ${!workersGroupMap[*]}
|
for worker in ${!workersGroupMap[*]}
|
||||||
do
|
do
|
||||||
workerState=`ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status worker-server;"`
|
workerState=`ssh -p $sshPort $worker "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status worker-server;"`
|
||||||
echo "$worker $workerState"
|
echo "$worker $workerState"
|
||||||
done
|
done
|
||||||
|
|
||||||
# 3.alter server check state
|
# 3.alter server check state
|
||||||
alertState=`ssh -p $sshPort $alertServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status alert-server;"`
|
alertState=`ssh -p $sshPort $alertServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status alert-server;"`
|
||||||
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 -p $sshPort $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh status api-server;"`
|
apiState=`ssh -p $sshPort $apiServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh status api-server;"`
|
||||||
echo "$apiServer $apiState"
|
echo "$apiServer $apiState"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
@ -21,8 +21,6 @@ workDir=`cd ${workDir};pwd`
|
||||||
|
|
||||||
source ${workDir}/env/install_env.sh
|
source ${workDir}/env/install_env.sh
|
||||||
|
|
||||||
declare -A workersGroupMap=()
|
|
||||||
|
|
||||||
workersGroup=(${workers//,/ })
|
workersGroup=(${workers//,/ })
|
||||||
for workerGroup in ${workersGroup[@]}
|
for workerGroup in ${workersGroup[@]}
|
||||||
do
|
do
|
||||||
|
|
@ -36,21 +34,21 @@ mastersHost=(${masters//,/ })
|
||||||
for master in ${mastersHost[@]}
|
for master in ${mastersHost[@]}
|
||||||
do
|
do
|
||||||
echo "$master master server is stopping"
|
echo "$master master server is stopping"
|
||||||
ssh -p $sshPort $master "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop master-server;"
|
ssh -p $sshPort $master "cd $installPath/; bash bin/dolphinscheduler-daemon.sh stop master-server;"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
for worker in ${!workersGroupMap[*]}
|
for worker in ${!workersGroupMap[*]}
|
||||||
do
|
do
|
||||||
echo "$worker worker server is stopping"
|
echo "$worker worker server is stopping"
|
||||||
ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop worker-server;"
|
ssh -p $sshPort $worker "cd $installPath/; bash bin/dolphinscheduler-daemon.sh stop worker-server;"
|
||||||
done
|
done
|
||||||
|
|
||||||
ssh -p $sshPort $alertServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop alert-server;"
|
ssh -p $sshPort $alertServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh stop alert-server;"
|
||||||
|
|
||||||
apiServersHost=(${apiServers//,/ })
|
apiServersHost=(${apiServers//,/ })
|
||||||
for apiServer in ${apiServersHost[@]}
|
for apiServer in ${apiServersHost[@]}
|
||||||
do
|
do
|
||||||
echo "$apiServer api server is stopping"
|
echo "$apiServer api server is stopping"
|
||||||
ssh -p $sshPort $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop api-server;"
|
ssh -p $sshPort $apiServer "cd $installPath/; bash bin/dolphinscheduler-daemon.sh stop api-server;"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue