|
|
@ -21,19 +21,14 @@ workDir=`cd ${workDir};pwd` |
|
|
|
|
|
|
|
|
|
|
|
source ${workDir}/env/install_env.sh |
|
|
|
source ${workDir}/env/install_env.sh |
|
|
|
|
|
|
|
|
|
|
|
txt="" |
|
|
|
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then |
|
|
|
|
|
|
|
# Mac OSX |
|
|
|
|
|
|
|
txt="''" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
workersGroup=(${workers//,/ }) |
|
|
|
workersGroup=(${workers//,/ }) |
|
|
|
for workerGroup in ${workersGroup[@]} |
|
|
|
for workerGroup in ${workersGroup[@]} |
|
|
|
do |
|
|
|
do |
|
|
|
echo $workerGroup; |
|
|
|
echo $workerGroup; |
|
|
|
worker=`echo $workerGroup|awk -F':' '{print $1}'` |
|
|
|
worker=`echo $workerGroup|awk -F':' '{print $1}'` |
|
|
|
groupsName=`echo $workerGroup|awk -F':' '{print $2}'` |
|
|
|
group=`echo $workerGroup|awk -F':' '{print $2}'` |
|
|
|
workersGroupMap+=([$worker]=$groupsName) |
|
|
|
workerNames+=($worker) |
|
|
|
|
|
|
|
groupNames+=(${group:-default}) |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
hostsArr=(${ips//,/ }) |
|
|
|
hostsArr=(${ips//,/ }) |
|
|
@ -47,17 +42,23 @@ do |
|
|
|
echo "scp dirs to $host/$installPath starting" |
|
|
|
echo "scp dirs to $host/$installPath starting" |
|
|
|
ssh -p $sshPort $host "cd $installPath/; rm -rf bin/ conf/ lib/ script/ sql/ ui/" |
|
|
|
ssh -p $sshPort $host "cd $installPath/; rm -rf bin/ conf/ lib/ script/ sql/ ui/" |
|
|
|
|
|
|
|
|
|
|
|
for dsDir in bin master-server worker-server alert-server api-server ui |
|
|
|
for i in ${!workerNames[@]}; do |
|
|
|
do |
|
|
|
if [[ ${workerNames[$i]} == $host ]]; then |
|
|
|
# if worker in workersGroupMap |
|
|
|
workerIndex=$i |
|
|
|
if [[ "${workersGroupMap[${host}]}" ]]; then |
|
|
|
break |
|
|
|
echo "export WORKER_GROUPS_0=${workersGroupMap[${host}]}" >> worker-server/bin/dolphinscheduler_env.sh |
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
# set worker groups in application.yaml |
|
|
|
|
|
|
|
[[ -n ${workerIndex} ]] && sed -i "s/- default/- ${groupNames[$workerIndex]}/" worker-server/conf/application.yaml |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for dsDir in bin master-server worker-server alert-server api-server ui |
|
|
|
|
|
|
|
do |
|
|
|
echo "start to scp $dsDir to $host/$installPath" |
|
|
|
echo "start to scp $dsDir to $host/$installPath" |
|
|
|
# Use quiet mode to reduce command line output |
|
|
|
# Use quiet mode to reduce command line output |
|
|
|
scp -q -P $sshPort -r $workDir/../$dsDir $host:$installPath |
|
|
|
scp -q -P $sshPort -r $workDir/../$dsDir $host:$installPath |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
# restore worker groups to default |
|
|
|
|
|
|
|
[[ -n ${workerIndex} ]] && sed -i "s/- ${groupNames[$workerIndex]}/- default/" worker-server/conf/application.yaml |
|
|
|
|
|
|
|
|
|
|
|
echo "scp dirs to $host/$installPath complete" |
|
|
|
echo "scp dirs to $host/$installPath complete" |
|
|
|
done |
|
|
|
done |
|
|
|