From 5813d6bed376df81b98fe6d517ef77a605b58391 Mon Sep 17 00:00:00 2001 From: Kirs Date: Thu, 2 Dec 2021 19:36:36 +0800 Subject: [PATCH] fix some config miss (#7133) --- .../dao/DaoConfiguration.java | 31 +++ .../src/main/resources/application-h2.yaml | 34 ++++ .../src/main/resources/application-mysql.yaml | 34 ++++ .../resources/application-postgresql.yaml | 34 ++++ .../dao/mapper/PluginDefineMapper.xml | 1 + .../resources/sql/dolphinscheduler_h2.sql | 185 +++++++++--------- .../resources/sql/dolphinscheduler_mysql.sql | 7 +- .../sql/dolphinscheduler_postgre.sql | 5 +- ...properties => application-standalone.yaml} | 20 +- 9 files changed, 256 insertions(+), 95 deletions(-) create mode 100644 dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java create mode 100644 dolphinscheduler-dao/src/main/resources/application-h2.yaml create mode 100644 dolphinscheduler-dao/src/main/resources/application-mysql.yaml create mode 100644 dolphinscheduler-dao/src/main/resources/application-postgresql.yaml rename dolphinscheduler-standalone-server/src/main/resources/{application-h2.properties => application-standalone.yaml} (76%) diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java new file mode 100644 index 0000000000..f0c78fcf44 --- /dev/null +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.dolphinscheduler.dao; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableAutoConfiguration +@MapperScan("org.apache.dolphinscheduler.dao") +public class DaoConfiguration { +} diff --git a/dolphinscheduler-dao/src/main/resources/application-h2.yaml b/dolphinscheduler-dao/src/main/resources/application-h2.yaml new file mode 100644 index 0000000000..147892c350 --- /dev/null +++ b/dolphinscheduler-dao/src/main/resources/application-h2.yaml @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +spring: + datasource: + driver-class-name: org.h2.Driver + url: jdbc:h2:mem:dolphinscheduler;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true;INIT=runscript from 'classpath:sql/dolphinscheduler_h2.sql' + username: sa + password: "" + hikari: + connection-test-query: select 1 + minimum-idle: 5 + auto-commit: true + validation-timeout: 3000 + pool-name: DolphinScheduler + maximum-pool-size: 50 + connection-timeout: 30000 + idle-timeout: 600000 + leak-detection-threshold: 0 + initialization-fail-timeout: 1 diff --git a/dolphinscheduler-dao/src/main/resources/application-mysql.yaml b/dolphinscheduler-dao/src/main/resources/application-mysql.yaml new file mode 100644 index 0000000000..be5872b906 --- /dev/null +++ b/dolphinscheduler-dao/src/main/resources/application-mysql.yaml @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +spring: + datasource: + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 + username: ds_user + password: dolphinscheduler + hikari: + connection-test-query: select 1 + minimum-idle: 5 + auto-commit: true + validation-timeout: 3000 + pool-name: DolphinScheduler + maximum-pool-size: 50 + connection-timeout: 30000 + idle-timeout: 600000 + leak-detection-threshold: 0 + initialization-fail-timeout: 1 diff --git a/dolphinscheduler-dao/src/main/resources/application-postgresql.yaml b/dolphinscheduler-dao/src/main/resources/application-postgresql.yaml new file mode 100644 index 0000000000..e5ad49ffae --- /dev/null +++ b/dolphinscheduler-dao/src/main/resources/application-postgresql.yaml @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +spring: + datasource: + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://127.0.0.1:5432/dolphinscheduler + username: root + password: root + hikari: + connection-test-query: select 1 + minimum-idle: 5 + auto-commit: true + validation-timeout: 3000 + pool-name: DolphinScheduler + maximum-pool-size: 50 + connection-timeout: 30000 + idle-timeout: 600000 + leak-detection-threshold: 0 + initialization-fail-timeout: 1 diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml index 329d2f14ad..f61b9d1de0 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml @@ -38,6 +38,7 @@ select * from t_ds_plugin_define where plugin_name = #{pluginName} and plugin_type = #{pluginType} + limit 1