From f7a7de95347f22e34fa05e14c1f7d5114b5609f1 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Fri, 10 Dec 2021 23:29:59 +0800 Subject: [PATCH] Fix some SQL issues and make docker-compose runnable --- .../postgresql/dolphinscheduler_ddl.sql | 3 ++- .../upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql | 1 + .../2.0.1_schema/postgresql/dolphinscheduler_ddl.sql | 2 +- .../dolphinscheduler/tools/datasource/dao/UpgradeDao.java | 2 +- dolphinscheduler-worker/src/main/docker/Dockerfile | 2 +- script/env/dolphinscheduler_env.sh | 8 ++++---- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-dao/src/main/resources/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql index 75a5d56e7715..29eae7b7e402 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/create/release-1.2.0_schema/postgresql/dolphinscheduler_ddl.sql @@ -375,6 +375,7 @@ DROP TABLE IF EXISTS t_ds_project; CREATE TABLE t_ds_project ( id int NOT NULL , name varchar(100) DEFAULT NULL , + code bigint NOT NULL, description varchar(200) DEFAULT NULL , user_id int DEFAULT NULL , flag int DEFAULT '1' , @@ -754,4 +755,4 @@ CREATE SEQUENCE t_ds_worker_group_id_sequence; ALTER TABLE t_ds_worker_group ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_group_id_sequence'); DROP SEQUENCE IF EXISTS t_ds_worker_server_id_sequence; CREATE SEQUENCE t_ds_worker_server_id_sequence; -ALTER TABLE t_ds_worker_server ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_server_id_sequence'); \ No newline at end of file +ALTER TABLE t_ds_worker_server ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_server_id_sequence'); diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql index d53a9c18ea82..cc5516df7a11 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql @@ -302,6 +302,7 @@ CREATE TABLE `t_ds_task_definition_log` ( `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute', `resource_ids` text DEFAULT NULL COMMENT 'resource id, separated by comma', `operator` int(11) DEFAULT NULL COMMENT 'operator user id', + `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', `operate_time` datetime DEFAULT NULL COMMENT 'operate time', `create_time` datetime NOT NULL COMMENT 'create time', `update_time` datetime NOT NULL COMMENT 'update time', diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.1_schema/postgresql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.1_schema/postgresql/dolphinscheduler_ddl.sql index b2d20e12a889..e2aba5acb691 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.1_schema/postgresql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.1_schema/postgresql/dolphinscheduler_ddl.sql @@ -40,4 +40,4 @@ $BODY$; select dolphin_update_metadata(); -d// \ No newline at end of file +d// diff --git a/dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/dao/UpgradeDao.java b/dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/dao/UpgradeDao.java index b5d21061272f..c337936cb05d 100644 --- a/dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/dao/UpgradeDao.java +++ b/dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/dao/UpgradeDao.java @@ -307,7 +307,7 @@ protected void updateProcessDefinitionJsonResourceList() { private void upgradeDolphinSchedulerDML(String schemaDir) { String schemaVersion = schemaDir.split("_")[0]; Resource sqlFilePath = new ClassPathResource(String.format("sql/upgrade/%s/%s/dolphinscheduler_dml.sql", schemaDir, getDbType().name().toLowerCase())); - logger.info("sqlSQLFilePath" + sqlFilePath); + logger.info("sqlSQLFilePath: {}", sqlFilePath); Connection conn = null; PreparedStatement pstmt = null; try { diff --git a/dolphinscheduler-worker/src/main/docker/Dockerfile b/dolphinscheduler-worker/src/main/docker/Dockerfile index 56fe98777485..b2b78cbdcd75 100644 --- a/dolphinscheduler-worker/src/main/docker/Dockerfile +++ b/dolphinscheduler-worker/src/main/docker/Dockerfile @@ -22,7 +22,7 @@ ENV TZ Asia/Shanghai ENV DOLPHINSCHEDULER_HOME /opt/dolphinscheduler RUN apt update ; \ - apt install -y curl ; \ + apt install -y curl sudo ; \ rm -rf /var/lib/apt/lists/* WORKDIR $DOLPHINSCHEDULER_HOME diff --git a/script/env/dolphinscheduler_env.sh b/script/env/dolphinscheduler_env.sh index f0fdbaa46eaa..bc6efabe867f 100755 --- a/script/env/dolphinscheduler_env.sh +++ b/script/env/dolphinscheduler_env.sh @@ -32,9 +32,9 @@ export SPRING_PROFILES_ACTIVE=${DATABASE} export SPRING_DATASOURCE_URL export SPRING_DATASOURCE_USERNAME export SPRING_DATASOURCE_PASSWORD -export SPRING_CACHE_TYPE=none +export SPRING_CACHE_TYPE=${SPRING_CACHE_TYPE:-none} -export MASTER_FETCH_COMMAND_NUM=10 +export MASTER_FETCH_COMMAND_NUM=${MASTER_FETCH_COMMAND_NUM:-10} -export REGISTRY_TYPE=zookeeper -export REGISTRY_ZOOKEEPER_CONNECT_STRING=localhost:2181 +export REGISTRY_TYPE=${REGISTRY_TYPE:-zookeeper} +export REGISTRY_ZOOKEEPER_CONNECT_STRING=${REGISTRY_ZOOKEEPER_CONNECT_STRING:-localhost:2181}