This commit is contained in:
JohnHuang 2024-06-11 23:07:44 -07:00 committed by GitHub
commit 8e88f9ef08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -31,6 +31,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;
@ -91,6 +92,9 @@ public class MasterServer implements IStoppable {
@Autowired
private TaskGroupCoordinator taskGroupCoordinator;
@Autowired
private MasterConfig masterConfig;
public static void main(String[] args) {
MasterServerMetrics.registerUncachedException(DefaultUncaughtExceptionHandler::getUncaughtExceptionCount);
@ -122,7 +126,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(() -> {

View File

@ -83,6 +83,10 @@ public class MasterConfig implements Validator {
* task submit retry interval.
*/
private Duration taskCommitInterval = Duration.ofSeconds(1);
/**
* if scheduler is enabled 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.
*/

View File

@ -83,6 +83,8 @@ registry:
master:
listen-port: 5678
# 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
# master execute thread number to limit process instances in parallel