Browse Source

change escheduler to dolphinscheduler (#958)

* rename from DatasourceUserMapper to DataSourceUserMapper

* add unit test in UserMapper and WorkerGroupMapper

* change cn.escheduler to org.apache.dolphinscheduler

* add unit test in UdfFuncMapperTest

* add unit test in UdfFuncMapperTest

* remove DatabaseConfiguration

* add ConnectionFactoryTest

* cal duration in processInstancesList

* change desc to description

* change table name in mysql ddl

* change table name in mysql ddl

* change escheduler to dolphinscheduler
pull/2/head
lgcareer 5 years ago committed by qiaozhanwei
parent
commit
c377d7d878
  1. 4
      dockerfile/conf/escheduler/conf/quartz.properties
  2. 24
      dolphinscheduler-common/src/main/resources/zookeeper.properties
  3. 4
      script/config/install_config.conf
  4. 12
      script/create-dolphinscheduler.sh
  5. 28
      script/dolphinscheduler-daemon.sh
  6. 10
      script/start-all.sh
  7. 10
      script/stop-all.sh
  8. 12
      script/upgrade-dolphinscheduler.sh
  9. 4
      sql/upgrade/1.2.0_schema/mysql/dolphinscheduler_ddl.sql

4
dockerfile/conf/escheduler/conf/quartz.properties

@ -1,7 +1,7 @@
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = EasyScheduler
org.quartz.scheduler.instanceName = DolphinScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.makeSchedulerThreadDaemon = true
org.quartz.jobStore.useProperties = false
@ -32,7 +32,7 @@ org.quartz.jobStore.dataSource = myDs
#============================================================================
org.quartz.dataSource.myDs.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.myDs.URL=jdbc:mysql://127.0.0.1:3306/escheduler?characterEncoding=utf8
org.quartz.dataSource.myDs.URL=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?characterEncoding=utf8
org.quartz.dataSource.myDs.user=root
org.quartz.dataSource.myDs.password=root@123
org.quartz.dataSource.myDs.maxConnections = 10

24
dolphinscheduler-common/src/main/resources/zookeeper.properties

@ -1,24 +1,24 @@
#zookeeper cluster. multiple are separated by commas. eg. 192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181
zookeeper.quorum=192.168.220.188:2181
#escheduler root directory
zookeeper.escheduler.root=/escheduler
#dolphinscheduler root directory
zookeeper.dolphinscheduler.root=/dolphinscheduler
#zookeeper server dirctory
zookeeper.escheduler.dead.servers=/escheduler/dead-servers
zookeeper.escheduler.masters=/escheduler/masters
zookeeper.escheduler.workers=/escheduler/workers
zookeeper.dolphinscheduler.dead.servers=/dolphinscheduler/dead-servers
zookeeper.dolphinscheduler.masters=/dolphinscheduler/masters
zookeeper.dolphinscheduler.workers=/dolphinscheduler/workers
#zookeeper lock dirctory
zookeeper.escheduler.lock.masters=/escheduler/lock/masters
zookeeper.escheduler.lock.workers=/escheduler/lock/workers
zookeeper.dolphinscheduler.lock.masters=/dolphinscheduler/lock/masters
zookeeper.dolphinscheduler.lock.workers=/dolphinscheduler/lock/workers
#escheduler failover directory
zookeeper.escheduler.lock.failover.masters=/escheduler/lock/failover/masters
zookeeper.escheduler.lock.failover.workers=/escheduler/lock/failover/workers
zookeeper.escheduler.lock.failover.startup.masters=/escheduler/lock/failover/startup-masters
#dolphinscheduler failover directory
zookeeper.dolphinscheduler.lock.failover.masters=/dolphinscheduler/lock/failover/masters
zookeeper.dolphinscheduler.lock.failover.workers=/dolphinscheduler/lock/failover/workers
zookeeper.dolphinscheduler.lock.failover.startup.masters=/dolphinscheduler/lock/failover/startup-masters
#escheduler failover directory
#dolphinscheduler failover directory
zookeeper.session.timeout=300
zookeeper.connection.timeout=300
zookeeper.retry.sleep=1000

4
script/config/install_config.conf

@ -1,3 +1,3 @@
installPath=/data1_1T/escheduler
deployUser=escheduler
installPath=/data1_1T/dolphinscheduler
deployUser=dolphinscheduler
ips=ark0,ark1,ark2,ark3,ark4

12
script/create-dolphinscheduler.sh

@ -2,20 +2,20 @@
BIN_DIR=`dirname $0`
BIN_DIR=`cd "$BIN_DIR"; pwd`
ESCHEDULER_HOME=$BIN_DIR/..
DOLPHINSCHEDULER_HOME=$BIN_DIR/..
export JAVA_HOME=$JAVA_HOME
export ESCHEDULER_CONF_DIR=$ESCHEDULER_HOME/conf
export ESCHEDULER_LIB_JARS=$ESCHEDULER_HOME/lib/*
export DOLPHINSCHEDULER_CONF_DIR=$DOLPHINSCHEDULER_HOME/conf
export DOLPHINSCHEDULER_LIB_JARS=$DOLPHINSCHEDULER_HOME/lib/*
export ESCHEDULER_OPTS="-server -Xmx1g -Xms1g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"
export DOLPHINSCHEDULER_OPTS="-server -Xmx1g -Xms1g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"
export STOP_TIMEOUT=5
CLASS=org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler
exec_command="$ESCHEDULER_OPTS -classpath $ESCHEDULER_CONF_DIR:$ESCHEDULER_LIB_JARS $CLASS"
exec_command="$DOLPHINSCHEDULER_OPTS -classpath $DOLPHINSCHEDULER_CONF_DIR:$DOLPHINSCHEDULER_LIB_JARS $CLASS"
cd $ESCHEDULER_HOME
cd $DOLPHINSCHEDULER_HOME
$JAVA_HOME/bin/java $exec_command

28
script/dolphinscheduler-daemon.sh

@ -1,6 +1,6 @@
#!/bin/sh
usage="Usage: escheduler-daemon.sh (start|stop) <command> "
usage="Usage: dolphinscheduler-daemon.sh (start|stop) <command> "
# if no args specified, show usage
if [ $# -le 1 ]; then
@ -17,28 +17,28 @@ echo "Begin $startStop $command......"
BIN_DIR=`dirname $0`
BIN_DIR=`cd "$BIN_DIR"; pwd`
ESCHEDULER_HOME=$BIN_DIR/..
DOLPHINSCHEDULER_HOME=$BIN_DIR/..
export JAVA_HOME=$JAVA_HOME
#export JAVA_HOME=/opt/soft/jdk
export HOSTNAME=`hostname`
export ESCHEDULER_PID_DIR=/tmp/
export ESCHEDULER_LOG_DIR=$ESCHEDULER_HOME/logs
export ESCHEDULER_CONF_DIR=$ESCHEDULER_HOME/conf
export ESCHEDULER_LIB_JARS=$ESCHEDULER_HOME/lib/*
export DOLPHINSCHEDULER_PID_DIR=/tmp/
export DOLPHINSCHEDULER_LOG_DIR=$DOLPHINSCHEDULER_HOME/logs
export DOLPHINSCHEDULER_CONF_DIR=$DOLPHINSCHEDULER_HOME/conf
export DOLPHINSCHEDULER_LIB_JARS=$DOLPHINSCHEDULER_HOME/lib/*
export ESCHEDULER_OPTS="-server -Xmx16g -Xms4g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"
export DOLPHINSCHEDULER_OPTS="-server -Xmx16g -Xms4g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"
export STOP_TIMEOUT=5
if [ ! -d "$ESCHEDULER_LOG_DIR" ]; then
mkdir $ESCHEDULER_LOG_DIR
if [ ! -d "$DOLPHINSCHEDULER_LOG_DIR" ]; then
mkdir $DOLPHINSCHEDULER_LOG_DIR
fi
log=$ESCHEDULER_LOG_DIR/escheduler-$command-$HOSTNAME.out
pid=$ESCHEDULER_LOG_DIR/escheduler-$command.pid
log=$DOLPHINSCHEDULER_LOG_DIR/dolphinscheduler-$command-$HOSTNAME.out
pid=$DOLPHINSCHEDULER_LOG_DIR/dolphinscheduler-$command.pid
cd $ESCHEDULER_HOME
cd $DOLPHINSCHEDULER_HOME
if [ "$command" = "api-server" ]; then
LOG_FILE="-Dlogging.config=conf/apiserver_logback.xml"
@ -61,7 +61,7 @@ fi
case $startStop in
(start)
[ -w "$ESCHEDULER_PID_DIR" ] || mkdir -p "$ESCHEDULER_PID_DIR"
[ -w "$DOLPHINSCHEDULER_PID_DIR" ] || mkdir -p "$DOLPHINSCHEDULER_PID_DIR"
if [ -f $pid ]; then
if kill -0 `cat $pid` > /dev/null 2>&1; then
@ -72,7 +72,7 @@ case $startStop in
echo starting $command, logging to $log
exec_command="$LOG_FILE $ESCHEDULER_OPTS -classpath $ESCHEDULER_CONF_DIR:$ESCHEDULER_LIB_JARS $CLASS"
exec_command="$LOG_FILE $DOLPHINSCHEDULER_OPTS -classpath $DOLPHINSCHEDULER_CONF_DIR:$DOLPHINSCHEDULER_LIB_JARS $CLASS"
echo "nohup $JAVA_HOME/bin/java $exec_command > $log 2>&1 < /dev/null &"
nohup $JAVA_HOME/bin/java $exec_command > $log 2>&1 < /dev/null &

10
script/start-all.sh

@ -9,7 +9,7 @@ mastersHost=(${masters//,/ })
for master in ${mastersHost[@]}
do
echo $master
ssh $master "cd $installPath/; sh bin/escheduler-daemon.sh start master-server;"
ssh $master "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start master-server;"
done
@ -18,17 +18,17 @@ for worker in ${workersHost[@]}
do
echo $worker
ssh $worker "cd $installPath/; sh bin/escheduler-daemon.sh start worker-server;"
ssh $worker "cd $installPath/; sh bin/escheduler-daemon.sh start logger-server;"
ssh $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start worker-server;"
ssh $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start logger-server;"
done
ssh $alertServer "cd $installPath/; sh bin/escheduler-daemon.sh start alert-server;"
ssh $alertServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start alert-server;"
apiServersHost=(${apiServers//,/ })
for apiServer in ${apiServersHost[@]}
do
echo $apiServer
ssh $apiServer "cd $installPath/; sh bin/escheduler-daemon.sh start api-server;"
ssh $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh start api-server;"
done

10
script/stop-all.sh

@ -10,7 +10,7 @@ mastersHost=(${masters//,/ })
for master in ${mastersHost[@]}
do
echo $master
ssh $master "cd $installPath/; sh bin/escheduler-daemon.sh stop master-server;"
ssh $master "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop master-server;"
done
@ -19,17 +19,17 @@ for worker in ${workersHost[@]}
do
echo $worker
ssh $worker "cd $installPath/; sh bin/escheduler-daemon.sh stop worker-server;"
ssh $worker "cd $installPath/; sh bin/escheduler-daemon.sh stop logger-server;"
ssh $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop worker-server;"
ssh $worker "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop logger-server;"
done
ssh $alertServer "cd $installPath/; sh bin/escheduler-daemon.sh stop alert-server;"
ssh $alertServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop alert-server;"
apiServersHost=(${apiServers//,/ })
for apiServer in ${apiServersHost[@]}
do
echo $apiServer
ssh $apiServer "cd $installPath/; sh bin/escheduler-daemon.sh stop api-server;"
ssh $apiServer "cd $installPath/; sh bin/dolphinscheduler-daemon.sh stop api-server;"
done

12
script/upgrade-dolphinscheduler.sh

@ -2,20 +2,20 @@
BIN_DIR=`dirname $0`
BIN_DIR=`cd "$BIN_DIR"; pwd`
ESCHEDULER_HOME=$BIN_DIR/..
DOLPHINSCHEDULER_HOME=$BIN_DIR/..
export JAVA_HOME=$JAVA_HOME
export ESCHEDULER_CONF_DIR=$ESCHEDULER_HOME/conf
export ESCHEDULER_LIB_JARS=$ESCHEDULER_HOME/lib/*
export DOLPHINSCHEDULER_CONF_DIR=$DOLPHINSCHEDULER_HOME/conf
export DOLPHINSCHEDULER_LIB_JARS=$DOLPHINSCHEDULER_HOME/lib/*
export ESCHEDULER_OPTS="-server -Xmx1g -Xms1g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"
export DOLPHINSCHEDULER_OPTS="-server -Xmx1g -Xms1g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"
export STOP_TIMEOUT=5
CLASS=org.apache.dolphinscheduler.dao.upgrade.shell.UpgradeDolphinScheduler
exec_command="$ESCHEDULER_OPTS -classpath $ESCHEDULER_CONF_DIR:$ESCHEDULER_LIB_JARS $CLASS"
exec_command="$DOLPHINSCHEDULER_OPTS -classpath $DOLPHINSCHEDULER_CONF_DIR:$DOLPHINSCHEDULER_LIB_JARS $CLASS"
cd $ESCHEDULER_HOME
cd $DOLPHINSCHEDULER_HOME
$JAVA_HOME/bin/java $exec_command

4
sql/upgrade/1.2.0_schema/mysql/dolphinscheduler_ddl.sql

@ -511,11 +511,11 @@ delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_dolphinscheduler_process_definition'
WHERE TABLE_NAME='t_ds_process_definition'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_dolphinscheduler_process_definition CHANGE COLUMN `desc` description text;
ALTER TABLE t_ds_process_definition CHANGE COLUMN `desc` description text;
END IF;
END;

Loading…
Cancel
Save