You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2020/05/18 10:04:31 UTC
[incubator-dolphinscheduler] branch dev-1.3.0 updated: update
worker group config (#2746)
This is an automated email from the ASF dual-hosted git repository.
lidongdai pushed a commit to branch dev-1.3.0
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev-1.3.0 by this push:
new b51c999 update worker group config (#2746)
b51c999 is described below
commit b51c9995524486a294bf33b84326aa2da857ed08
Author: dailidong <da...@gmail.com>
AuthorDate: Mon May 18 18:04:24 2020 +0800
update worker group config (#2746)
* fix worker group config no effect
* remove codehaus janino jar
the license about janino maybe not compatiable with Apache v2
* Merge remote-tracking branch 'upstream/dev-1.3.0' into dev-1.3.0
# Conflicts:
# dolphinscheduler-server/src/main/resources/config/install_config.conf
* Update datasource.properties
---
dolphinscheduler-common/pom.xml | 6 ------
.../src/main/resources/datasource.properties | 3 +--
script/scp-hosts.sh | 18 +++++++++++++++---
script/start-all.sh | 13 ++++++++++++-
script/stop-all.sh | 13 ++++++++++++-
5 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/dolphinscheduler-common/pom.xml b/dolphinscheduler-common/pom.xml
index 3954159..af1b2e4 100644
--- a/dolphinscheduler-common/pom.xml
+++ b/dolphinscheduler-common/pom.xml
@@ -29,7 +29,6 @@
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <codehaus.janino.version>3.1.0</codehaus.janino.version>
</properties>
<dependencies>
<dependency>
@@ -589,10 +588,5 @@
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.janino</groupId>
- <artifactId>janino</artifactId>
- <version>${codehaus.janino.version}</version>
- </dependency>
</dependencies>
</project>
diff --git a/dolphinscheduler-dao/src/main/resources/datasource.properties b/dolphinscheduler-dao/src/main/resources/datasource.properties
index 984aa17..25ac220 100644
--- a/dolphinscheduler-dao/src/main/resources/datasource.properties
+++ b/dolphinscheduler-dao/src/main/resources/datasource.properties
@@ -21,7 +21,6 @@ spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler
spring.datasource.username=test
spring.datasource.password=test
-# mysql
# connection configuration
#spring.datasource.initialSize=5
# min connection number
@@ -61,4 +60,4 @@ spring.datasource.password=test
# open PSCache, specify count PSCache for every connection
#spring.datasource.poolPreparedStatements=true
-#spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
\ No newline at end of file
+#spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
diff --git a/script/scp-hosts.sh b/script/scp-hosts.sh
index 6e85566..4a94cff 100644
--- a/script/scp-hosts.sh
+++ b/script/scp-hosts.sh
@@ -26,6 +26,18 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
txt="''"
fi
+declare -A workersGroupMap=()
+
+workersGroup=(${workers//,/ })
+for workerGroup in ${workersGroup[@]}
+do
+ echo $workerGroup;
+ worker=`echo $workerGroup|awk -F':' '{print $1}'`
+ groupName=`echo $workerGroup|awk -F':' '{print $2}'`
+ workersGroupMap+=([$worker]=$groupName)
+done
+
+
hostsArr=(${ips//,/ })
for host in ${hostsArr[@]}
do
@@ -39,9 +51,9 @@ do
for dsDir in bin conf lib script sql ui install.sh
do
- # if worker in workersGroup
- if [[ "${workersGroup[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then
- sed -i ${txt} "s#worker.group.*#worker.group=${workersGroup[${host}]}#g" ${dsDir}/worker.properties
+ # if worker in workersGroupMap
+ if [[ "${workersGroupMap[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then
+ sed -i ${txt} "s#worker.group.*#worker.group=${workersGroupMap[${host}]}#g" ${dsDir}/worker.properties
fi
echo "start to scp $dsDir to $host/$installPath"
diff --git a/script/start-all.sh b/script/start-all.sh
index dda46f0..61b9164 100644
--- a/script/start-all.sh
+++ b/script/start-all.sh
@@ -20,6 +20,17 @@ workDir=`dirname $0`
workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/install_config.conf
+declare -A workersGroupMap=()
+
+workersGroup=(${workers//,/ })
+for workerGroup in ${workersGroup[@]}
+do
+ echo $workerGroup;
+ worker=`echo $workerGroup|awk -F':' '{print $1}'`
+ groupName=`echo $workerGroup|awk -F':' '{print $2}'`
+ workersGroupMap+=([$worker]=$groupName)
+done
+
mastersHost=(${masters//,/ })
for master in ${mastersHost[@]}
do
@@ -28,7 +39,7 @@ do
done
-for worker in ${!workersGroup[*]}
+for worker in ${!workersGroupMap[*]}
do
echo "$worker worker server is starting"
diff --git a/script/stop-all.sh b/script/stop-all.sh
index e2afd08..dc18dae 100644
--- a/script/stop-all.sh
+++ b/script/stop-all.sh
@@ -21,6 +21,17 @@ workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/install_config.conf
+declare -A workersGroupMap=()
+
+workersGroup=(${workers//,/ })
+for workerGroup in ${workersGroup[@]}
+do
+ echo $workerGroup;
+ worker=`echo $workerGroup|awk -F':' '{print $1}'`
+ groupName=`echo $workerGroup|awk -F':' '{print $2}'`
+ workersGroupMap+=([$worker]=$groupName)
+done
+
mastersHost=(${masters//,/ })
for master in ${mastersHost[@]}
do
@@ -29,7 +40,7 @@ do
done
-for worker in ${!workersGroup[*]}
+for worker in ${!workersGroupMap[*]}
do
echo "$worker worker server is stopping"
ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop worker-server;"