From 2e9f61cc3bae2599762b2a250d7f29218416aa9d Mon Sep 17 00:00:00 2001 From: pegasas Date: Sun, 12 May 2024 07:55:03 +0800 Subject: [PATCH 1/4] [Improvement][Master] Add Quartz Enable Control Update dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java Co-authored-by: Wenjun Ruan Update dolphinscheduler-master/src/main/resources/application.yaml Co-authored-by: Wenjun Ruan fix comments --- .../dolphinscheduler/server/master/MasterServer.java | 8 +++++++- .../server/master/config/MasterConfig.java | 4 ++++ .../src/main/resources/application.yaml | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java index 7988570135..2bc65d8b48 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java @@ -30,6 +30,7 @@ import org.apache.dolphinscheduler.plugin.storage.api.StorageConfiguration; import org.apache.dolphinscheduler.plugin.task.api.TaskPluginManager; import org.apache.dolphinscheduler.registry.api.RegistryConfiguration; import org.apache.dolphinscheduler.scheduler.api.SchedulerApi; +import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.metrics.MasterServerMetrics; import org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient; import org.apache.dolphinscheduler.server.master.registry.MasterSlotManager; @@ -90,6 +91,9 @@ public class MasterServer implements IStoppable { @Autowired private TaskGroupCoordinator taskGroupCoordinator; + @Autowired + private MasterConfig masterConfig; + public static void main(String[] args) { MasterServerMetrics.registerUncachedException(DefaultUncaughtExceptionHandler::getUncaughtExceptionCount); @@ -120,7 +124,9 @@ public class MasterServer implements IStoppable { this.eventExecuteService.start(); this.failoverExecuteThread.start(); - this.schedulerApi.start(); + if (masterConfig.isSchedulerEnabled()) { + this.schedulerApi.start(); + } this.taskGroupCoordinator.start(); MasterServerMetrics.registerMasterCpuUsageGauge(() -> { diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java index 20d3cccef3..3ba4ad4820 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java @@ -83,6 +83,10 @@ public class MasterConfig implements Validator { * task submit retry interval. */ private Duration taskCommitInterval = Duration.ofSeconds(1); + /** + * if scheduler enable to schedule job on master + */ + private boolean schedulerEnabled = true; /** * state wheel check interval, if this value is bigger, may increase the delay of task/processInstance. */ diff --git a/dolphinscheduler-master/src/main/resources/application.yaml b/dolphinscheduler-master/src/main/resources/application.yaml index 17b1e41a71..f65ac92fe1 100644 --- a/dolphinscheduler-master/src/main/resources/application.yaml +++ b/dolphinscheduler-master/src/main/resources/application.yaml @@ -84,6 +84,8 @@ registry: master: listen-port: 5678 # master prepare execute thread number to limit handle commands in parallel + scheduler-enabled: true + # master prepare execute thread number to limit handle commands in parallel pre-exec-threads: 10 # master execute thread number to limit process instances in parallel exec-threads: 100 From c1e2e666f986fd82ceab6d93720e7f1c196bda46 Mon Sep 17 00:00:00 2001 From: JohnHuang Date: Sun, 12 May 2024 17:31:59 +0800 Subject: [PATCH 2/4] Update dolphinscheduler-master/src/main/resources/application.yaml Co-authored-by: Wenjun Ruan --- dolphinscheduler-master/src/main/resources/application.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-master/src/main/resources/application.yaml b/dolphinscheduler-master/src/main/resources/application.yaml index f65ac92fe1..4e1d8a1890 100644 --- a/dolphinscheduler-master/src/main/resources/application.yaml +++ b/dolphinscheduler-master/src/main/resources/application.yaml @@ -83,7 +83,7 @@ registry: master: listen-port: 5678 - # master prepare execute thread number to limit handle commands in parallel + # Whether enable the master trigger scheduler. scheduler-enabled: true # master prepare execute thread number to limit handle commands in parallel pre-exec-threads: 10 From 576515324b0f6b404a458ac796cfd42804e63f79 Mon Sep 17 00:00:00 2001 From: JohnHuang Date: Sun, 12 May 2024 23:26:26 +0800 Subject: [PATCH 3/4] Update dolphinscheduler-master/src/main/resources/application.yaml Co-authored-by: Aaron Wang --- dolphinscheduler-master/src/main/resources/application.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-master/src/main/resources/application.yaml b/dolphinscheduler-master/src/main/resources/application.yaml index 4e1d8a1890..cef38a7644 100644 --- a/dolphinscheduler-master/src/main/resources/application.yaml +++ b/dolphinscheduler-master/src/main/resources/application.yaml @@ -83,7 +83,7 @@ registry: master: listen-port: 5678 - # Whether enable the master trigger scheduler. + # Whether to enable the master trigger scheduler. scheduler-enabled: true # master prepare execute thread number to limit handle commands in parallel pre-exec-threads: 10 From 96b790be77ff246bdfcbb87efb289584cd7661a9 Mon Sep 17 00:00:00 2001 From: JohnHuang Date: Wed, 15 May 2024 16:30:04 +0800 Subject: [PATCH 4/4] Update dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java Co-authored-by: Aaron Wang --- .../dolphinscheduler/server/master/config/MasterConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java index 3ba4ad4820..3ed9dce432 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/config/MasterConfig.java @@ -84,7 +84,7 @@ public class MasterConfig implements Validator { */ private Duration taskCommitInterval = Duration.ofSeconds(1); /** - * if scheduler enable to schedule job on master + * if scheduler is enabled to schedule job on master */ private boolean schedulerEnabled = true; /**