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
data_quality_design
dailidong 4 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. 3
      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>
<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>

3
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
#spring.datasource.maxPoolPreparedStatementPerConnectionSize=20

18
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"

13
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"

13
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;"

Loading…
Cancel
Save