|
|
|
@ -21,19 +21,14 @@ workDir=`cd ${workDir};pwd`
|
|
|
|
|
|
|
|
|
|
source ${workDir}/env/install_env.sh |
|
|
|
|
|
|
|
|
|
txt="" |
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then |
|
|
|
|
# Mac OSX |
|
|
|
|
txt="''" |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
workersGroup=(${workers//,/ }) |
|
|
|
|
for workerGroup in ${workersGroup[@]} |
|
|
|
|
do |
|
|
|
|
echo $workerGroup; |
|
|
|
|
worker=`echo $workerGroup|awk -F':' '{print $1}'` |
|
|
|
|
groupsName=`echo $workerGroup|awk -F':' '{print $2}'` |
|
|
|
|
workersGroupMap+=([$worker]=$groupsName) |
|
|
|
|
group=`echo $workerGroup|awk -F':' '{print $2}'` |
|
|
|
|
workerNames+=($worker) |
|
|
|
|
groupNames+=(${group:-default}) |
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
hostsArr=(${ips//,/ }) |
|
|
|
@ -47,17 +42,23 @@ do
|
|
|
|
|
echo "scp dirs to $host/$installPath starting" |
|
|
|
|
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 |
|
|
|
|
do |
|
|
|
|
# if worker in workersGroupMap |
|
|
|
|
if [[ "${workersGroupMap[${host}]}" ]]; then |
|
|
|
|
echo "export WORKER_GROUPS_0=${workersGroupMap[${host}]}" >> worker-server/bin/dolphinscheduler_env.sh |
|
|
|
|
for i in ${!workerNames[@]}; do |
|
|
|
|
if [[ ${workerNames[$i]} == $host ]]; then |
|
|
|
|
workerIndex=$i |
|
|
|
|
break |
|
|
|
|
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" |
|
|
|
|
# Use quiet mode to reduce command line output |
|
|
|
|
scp -q -P $sshPort -r $workDir/../$dsDir $host:$installPath |
|
|
|
|
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" |
|
|
|
|
done |
|
|
|
|