Browse Source

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
pull/3/MERGE
dailidong 5 years ago committed by GitHub
parent
commit
b51c999552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-common/pom.xml
  2. 1
      dolphinscheduler-dao/src/main/resources/datasource.properties
  3. 18
      script/scp-hosts.sh
  4. 13
      script/start-all.sh
  5. 13
      script/stop-all.sh

6
dolphinscheduler-common/pom.xml

@ -29,7 +29,6 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<codehaus.janino.version>3.1.0</codehaus.janino.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -589,10 +588,5 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>${codehaus.janino.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

1
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.username=test
spring.datasource.password=test spring.datasource.password=test
# mysql
# connection configuration # connection configuration
#spring.datasource.initialSize=5 #spring.datasource.initialSize=5
# min connection number # min connection number

18
script/scp-hosts.sh

@ -26,6 +26,18 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
txt="''" txt="''"
fi 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//,/ }) hostsArr=(${ips//,/ })
for host in ${hostsArr[@]} for host in ${hostsArr[@]}
do do
@ -39,9 +51,9 @@ do
for dsDir in bin conf lib script sql ui install.sh for dsDir in bin conf lib script sql ui install.sh
do do
# if worker in workersGroup # if worker in workersGroupMap
if [[ "${workersGroup[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then if [[ "${workersGroupMap[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then
sed -i ${txt} "s#worker.group.*#worker.group=${workersGroup[${host}]}#g" ${dsDir}/worker.properties sed -i ${txt} "s#worker.group.*#worker.group=${workersGroupMap[${host}]}#g" ${dsDir}/worker.properties
fi fi
echo "start to scp $dsDir to $host/$installPath" echo "start to scp $dsDir to $host/$installPath"

13
script/start-all.sh

@ -20,6 +20,17 @@ workDir=`dirname $0`
workDir=`cd ${workDir};pwd` workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/install_config.conf 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//,/ }) mastersHost=(${masters//,/ })
for master in ${mastersHost[@]} for master in ${mastersHost[@]}
do do
@ -28,7 +39,7 @@ do
done done
for worker in ${!workersGroup[*]} for worker in ${!workersGroupMap[*]}
do do
echo "$worker worker server is starting" echo "$worker worker server is starting"

13
script/stop-all.sh

@ -21,6 +21,17 @@ workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/install_config.conf 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//,/ }) mastersHost=(${masters//,/ })
for master in ${mastersHost[@]} for master in ${mastersHost[@]}
do do
@ -29,7 +40,7 @@ do
done done
for worker in ${!workersGroup[*]} for worker in ${!workersGroupMap[*]}
do do
echo "$worker worker server is stopping" echo "$worker worker server is stopping"
ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop worker-server;" ssh -p $sshPort $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop worker-server;"

Loading…
Cancel
Save