Browse Source

[Feature][server]support one worker can belongs different worker groups when execute install script (#3307)

pull/3/MERGE
lgcareer 4 years ago committed by GitHub
parent
commit
6b964be60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-server/src/main/resources/worker.properties
  2. 9
      script/scp-hosts.sh

4
dolphinscheduler-server/src/main/resources/worker.properties

@ -30,5 +30,5 @@
# worker listener port
#worker.listen.port: 1234
# default worker group
#worker.groups=default
# default worker group,if this worker belongs different groups,you can config the following like that `worker.groups=default,test`
worker.groups=default

9
script/scp-hosts.sh

@ -34,7 +34,12 @@ do
echo $workerGroup;
worker=`echo $workerGroup|awk -F':' '{print $1}'`
groupName=`echo $workerGroup|awk -F':' '{print $2}'`
workersGroupMap+=([$worker]=$groupName)
if [ -z ${workersGroupMap[$worker]} ];then
workersGroupMap+=([$worker]=$groupName)
else
finalGroupName="${workersGroupMap[$worker]},$groupName"
workersGroupMap[$worker]=$finalGroupName
fi
done
@ -53,7 +58,7 @@ do
do
# if worker in workersGroupMap
if [[ "${workersGroupMap[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then
sed -i ${txt} "s#worker.group.*#worker.group=${workersGroupMap[${host}]}#g" ${dsDir}/worker.properties
sed -i ${txt} "s#worker.groups.*#worker.groups=${workersGroupMap[${host}]}#g" ${dsDir}/worker.properties
fi
echo "start to scp $dsDir to $host/$installPath"

Loading…
Cancel
Save