You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by jo...@apache.org on 2020/07/28 02:55:45 UTC

[incubator-dolphinscheduler] branch 1.3.2-release updated: [Feature][server]support one worker can belongs different worker groups when execute install script (#3307)

This is an automated email from the ASF dual-hosted git repository.

journey pushed a commit to branch 1.3.2-release
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/1.3.2-release by this push:
     new 6b964be  [Feature][server]support one worker can belongs different worker groups when execute install script (#3307)
6b964be is described below

commit 6b964be60a2f35b9a77963c76302500c91f98549
Author: lgcareer <18...@163.com>
AuthorDate: Tue Jul 28 10:55:35 2020 +0800

    [Feature][server]support one worker can belongs different worker groups when execute install script (#3307)
---
 dolphinscheduler-server/src/main/resources/worker.properties | 4 ++--
 script/scp-hosts.sh                                          | 9 +++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dolphinscheduler-server/src/main/resources/worker.properties b/dolphinscheduler-server/src/main/resources/worker.properties
index 0365c8a..72e7163 100644
--- a/dolphinscheduler-server/src/main/resources/worker.properties
+++ b/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
diff --git a/script/scp-hosts.sh b/script/scp-hosts.sh
index 4a94cff..27ee932 100644
--- a/script/scp-hosts.sh
+++ b/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"