本文系统梳理 Apache 3.3.2 各服务(master/worker/api/alert/standalone)目录、JVM、数据源、注册中心、存储、Quartz、环境变量及日志等关键配置项、默认值与作用,为部署调优提供一站式参考。
dolphinscheduler-daemon.sh
dolphinscheduler-daemon.sh 脚本负责 DolphinScheduler 的启动&关闭。start-all.sh/stop-all.sh 最终也是通过 dolphinscheduler-daemon.sh 对集群进行启动/关闭操作。目前 DolphinScheduler 只是做了一个基本的设置,JVM 参数请根据各自资源的实际情况自行设置。
默认简化参数如下:

注意事项:
- 不建议设置 "-XX:DisableExplicitGC",DolphinScheduler 使用 Netty 进行通讯,设置该参数可能会导致内存泄漏。
- 如果设置 "-Djava.net.preferIPv6Addresses=true" 将会使用 ipv6 的 IP 地址
- 如果设置 "-Djava.net.preferIPv4Addresses=true" 将会使用 ipv4 的 IP 地址
- 如果都不设置,将会随机使用 ipv4 或者 ipv6
在 DolphinScheduler 中使用 Spring Hikari 对数据库连接进行管理,配置文件位置:
| |
|---|
| master-server/conf/application.yaml |
| api-server/conf/application.yaml |
| worker-server/conf/application.yaml |
| alert-server/conf/application.yaml |
默认配置
| | |
|---|
| spring.datasource.driver-class-name | | |
| jdbc:postgresql://127.0.0.1:5432/dolphinscheduler | |
| spring.datasource.username | | |
| spring.datasource.password | | |
| spring.datasource.hikari.connection-test-query | | |
| spring.datasource.hikari.minimum-idle | | |
| spring.datasource.hikari.auto-commit | | |
| spring.datasource.hikari.pool-name | | |
| spring.datasource.hikari.maximum-pool-size | | |
| spring.datasource.hikari.connection-timeout | | |
| spring.datasource.hikari.idle-timeout | | |
| spring.datasource.hikari.leak-detection-threshold | | |
| spring.datasource.hikari.initialization-fail-timeout | | |
注意: DolphinScheduler 同样可以通过设置环境变量进行数据库连接相关的配置,将以上小写字母转成大写并把.换成_作为环境变量名,设置值即可。
DolphinScheduler 默认使用 Zookeeper 进行集群管理、容错、事件监听等功能,配置文件位置:
| |
|---|
| master-server/conf/application.yaml |
| api-server/conf/application.yaml |
| worker-server/conf/application.yaml |
默认配置
| | |
|---|
| registry.zookeeper.namespace | | |
| registry.zookeeper.connect-string | | |
| registry.zookeeper.retry-policy.base-sleep-time | | |
| registry.zookeeper.retry-policy.max-sleep | | |
| registry.zookeeper.retry-policy.max-retries | | |
| registry.zookeeper.session-timeout | | |
| registry.zookeeper.connection-timeout | | |
| registry.zookeeper.block-until-connected | | |
| registry.zookeeper.digest | | 如果zookeeper打开了acl,则需要填写认证信息访问znode,认证信息格式为{用户名}:{密码} |
注意:
- DolphinScheduler 同样可以通过 bin/env/dolphinscheduler_env.sh 进行 Zookeeper 相关的配置
common.properties 配置文件目前主要是配置 hadoop/s3/yarn/applicationId 收集相关的配置,配置文件位置:
| |
|---|
| master-server/conf/common.properties |
| api-server/conf/common.properties |
| worker-server/conf/common.properties |
| alert-server/conf/common.properties |
默认配置
| | |
|---|
| | |
| | 资源文件存储类型: HDFS,S3,OSS,GCS,ABS,NONE |
| | |
| | |
| | |
| | |
| | |
| | 如果存储类型为HDFS,需要配置拥有对应操作权限的用户 |
| | 请求地址如果resource.storage.type=S3,该值类似为: s3a://dolphinscheduler。如果resource.storage.type=HDFS,如果hadoop配置了HA,需要复制core-site.xml和hdfs-site.xml文件到conf目录 |
| hadoop.security.authentication.startup.state | | |
| java.security.krb5.conf.path | | |
| login.user.keytab.username | | |
| /opt/hdfs.headless.keytab | |
| | |
| yarn.resourcemanager.ha.rm.ids | 192.168.xx.xx,192.168.xx.xx | yarn resourcemanager地址,如果resourcemanager开启了HA,输入HA的IP地址(以逗号分隔),如果resourcemanager为单节点,该值为空即可 |
| yarn.application.status.address | http://ds1:8088/ws/v1/cluster/apps/%s | 如果resourcemanager开启了HA或者没有使用resourcemanager,保持默认值即可。如果resourcemanager为单节点,你需要将ds1配置为resourcemanager对应的hostname |
| | |
| dolphin.scheduler.network.interface.preferred | | |
| dolphin.scheduler.network.interface.restrict | | |
| dolphin.scheduler.network.priority.strategy | | |
| resource.manager.httpaddress.port | | |
| yarn.job.history.status.address | http://ds1:19888/ws/v1/history/mapreduce/jobs/%s | |
| datasource.encryption.enable | | |
| datasource.encryption.salt | | |
| | 设置hive SQL是否在同一个session中执行 |
| | |
| | zeppelin RESTful API 接口地址 |
| | 收集applicationId方式,如果用aop方法,将配置log替换为aop,并将bin/env/dolphinscheduler_env.sh自动收集applicationId相关环境变量配置的注释取消掉 |
位置: api-server/conf/application.yaml
| | |
|---|
| | |
| server.servlet.session.timeout | | |
| server.servlet.context-path | | |
| spring.servlet.multipart.max-file-size | | |
| spring.servlet.multipart.max-request-size | | |
| server.jetty.max-http-post-size | | |
| | |
| | |
| spring.jackson.date-format | | |
| | |
| security.authentication.type | | |
| security.authentication.ldap.user.admin | | |
| security.authentication.ldap.urls | ldap://ldap.forumsys.com:389/ | |
| security.authentication.ldap.base.dn | | |
| security.authentication.ldap.username | cn=read-only-admin,dc=example,dc=com | |
| security.authentication.ldap.password | | |
| security.authentication.ldap.user.identity-attribute | | |
| security.authentication.ldap.user.email-attribute | | |
| security.authentication.ldap.user.not-exist-action | | 当通过LDAP登陆时用户不存在的操作,默认值是: CREATE,可选值:CREATE、DENY |
| security.authentication.ldap.ssl.enable | | |
| security.authentication.ldap.ssl.trust-store | | |
| security.authentication.ldap.ssl.trust-store-password | | |
| security.authentication.casdoor.user.admin | | |
| | |
| | |
| | |
| | |
| casdoor.organization-name | | |
| | |
| | |
| api.traffic.control.global.switch | | |
| api.traffic.control.max-global-qps-rate | | |
| api.traffic.control.tenant-switch | | |
| api.traffic.control.default-tenant-qps-rate | | |
| api.traffic.control.customize-tenant-qps-rate | | |
位置: master-server/conf/application.yaml
| | |
|---|
| | |
| | master准备执行任务的数量,用于限制并行的command |
| | master工作线程数量,用于限制并行的流程实例数量 |
| master.dispatch-task-number | | |
| master.worker-load-balancer-configuration-properties.type | DYNAMIC_WEIGHTED_ROUND_ROBIN | Master将会使用Worker的动态CPU/Memory/线程池使用率来计算Worker的负载,负载越低的worker将会有更高的机会被分发任务 |
| master.max-heartbeat-interval | | |
| master.task-commit-retry-times | | |
| master.task-commit-interval | | |
| master.state-wheel-interval | | |
| master.server-load-protection.enabled | | |
| master.server-load-protection.max-system-cpu-usage-percentage-thresholds | | master最大系统cpu使用值,只有当前系统cpu使用值低于最大系统cpu使用值,master服务才能调度任务。默认值为0.7: 会使用70%的操作系统CPU |
| master.server-load-protection.max-jvm-cpu-usage-percentage-thresholds | | master最大JVM cpu使用值,只有当前JVM cpu使用值低于最大JVM cpu使用值,master服务才能调度任务。默认值为0.7: 会使用70%的JVM CPU |
| master.server-load-protection.max-system-memory-usage-percentage-thresholds | | master最大系统内存使用值,只有当前系统内存使用值低于最大系统内存使用值,master服务才能调度任务。默认值为0.7: 会使用70%的操作系统内存 |
| master.server-load-protection.max-disk-usage-percentage-thresholds | | master最大系统磁盘使用值,只有当前系统磁盘使用值低于最大系统磁盘使用值,master服务才能调度任务。默认值为0.7: 会使用70%的操作系统磁盘空间 |
| master.server-load-protection.max-concurrent-workflow-instances | | Master最大并发工作流实例数。当Master的工作流实例数达到或超过此值时,Master服务将被标记为繁忙 |
| | |
| master.kill-application-when-task-failover | | 当任务实例failover时,是否kill掉yarn或k8s application |
| master.master.worker-group-refresh-interval | | 定期将workerGroup从数据库中同步到内存的时间间隔 |
| master.command-fetch-strategy.type | | Command拉取策略,目前仅支持 ID_SLOT_BASED |
| master.command-fetch-strategy.config.id-step | | |
| master.command-fetch-strategy.config.fetch-size | | |
位置: worker-server/conf/application.yaml
| | |
|---|
| | |
| worker.max-heartbeat-interval | | |
| | |
| worker.tenant-auto-create | | 租户对应于系统的用户,由worker提交作业。如果系统没有该用户,则在参数worker.tenant.auto.create为true后自动创建。 |
| worker.server-load-protection.enabled | | |
| worker.server-load-protection.max-system-cpu-usage-percentage-thresholds | | worker最大系统cpu使用值,只有当前系统cpu使用值低于最大系统cpu使用值,worker服务才能接收任务。默认值为0.8: 会使用80%的操作系统CPU |
| worker.server-load-protection.max-jvm-cpu-usage-percentage-thresholds | | worker最大JVM cpu使用值,只有当前JVM cpu使用值低于最大JVM cpu使用值,worker服务才能接收任务。默认值为0.8: 会使用80%的JVM CPU |
| worker.server-load-protection.max-system-memory-usage-percentage-thresholds | | worker最大系统内存使用值,只有当前系统内存使用值低于最大系统内存使用值,worker服务才能接收任务。默认值为0.8: 会使用80%的操作系统内存 |
| worker.server-load-protection.max-disk-usage-percentage-thresholds | | worker最大系统磁盘使用值,只有当前系统磁盘使用值低于最大系统磁盘使用值,worker服务才能接收任务。默认值为0.8: 会使用80%的操作系统磁盘空间 |
| | |
| | |
| worker.physical-task-config.task-executor-thread-size | | |
| worker.tenant-config.auto-create-tenant-enabled | | 租户对应于系统的用户,由worker提交作业。如果系统没有该用户,则在参数worker.tenant.auto.create为true后自动创建。 |
| worker.tenant-config.default-tenant-enabled | | 如果设置为true,将会使用worker服务启动用户作为 default 租户。 |
位置: alert-server/conf/application.yaml
这里面主要是 quartz 配置,请结合实际业务场景&资源进行配置,本文暂时不做展开,配置文件位置:
| |
|---|
| master-server/conf/application.yaml |
| api-server/conf/application.yaml |
默认配置
| |
|---|
| spring.quartz.properties.org.quartz.jobStore.isClustered | |
| spring.quartz.properties.org.quartz.jobStore.class | org.quartz.impl.jdbcjobstore.JobStoreTX |
| spring.quartz.properties.org.quartz.scheduler.instanceId | |
| spring.quartz.properties.org.quartz.jobStore.tablePrefix | |
| spring.quartz.properties.org.quartz.jobStore.acquireTriggersWithinLock | |
| spring.quartz.properties.org.quartz.scheduler.instanceName | |
| spring.quartz.properties.org.quartz.jobStore.useProperties | |
| spring.quartz.properties.org.quartz.jobStore.misfireThreshold | |
| spring.quartz.properties.org.quartz.scheduler.makeSchedulerThreadDaemon | |
| spring.quartz.properties.org.quartz.jobStore.driverDelegateClass | org.quartz.impl.jdbcjobstore.PostgreSQLDelegate |
| spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval | |
Quartz 线程池配置差异
Master Server 的 Quartz 线程池默认配置:
| |
|---|
| spring.quartz.properties.org.quartz.threadPool.makeThreadsDaemons | |
| spring.quartz.properties.org.quartz.threadPool.threadCount | |
| spring.quartz.properties.org.quartz.threadPool.threadPriority | |
| spring.quartz.properties.org.quartz.threadPool.class | org.quartz.simpl.SimpleThreadPool |
Api Server 的 Quartz 线程池配置:
因为 Api Server 不会启动 Quartz Scheduler 实例,只会作为 Scheduler 客户端使用,因此它的 Quartz 线程池将会使用 QuartzZeroSizeThreadPool。QuartzZeroSizeThreadPool 不会启动任何线程。
| |
|---|
| spring.quartz.properties.org.quartz.threadPool.class | org.apache.dolphinscheduler.scheduler.quartz.QuartzZeroSizeThreadPool |
通过类似 shell 方式提交任务的的时候,会加载该配置文件中的环境变量到主机中。涉及到的 JAVA_HOME 任务类型的环境配置,其中任务类型主要有:Shell 任务、Python 任务、Spark 任务、Flink 任务、Datax 任务等等。
| |
|---|
| master-server/conf/logback-spring.xml |
| api-server/conf/logback-spring.xml |
| worker-server/conf/logback-spring.xml |
| |
- GitHub: https://github.com/apache/dolphinscheduler
- 官网:https://dolphinscheduler.apache.org/en-us
- 订阅开发者邮件:dev@dolphinscheduler@apache.org(向邮箱发送任意内容,收到邮件后回复同意订阅即可)
- YouTube:https://www.youtube.com/@apachedolphinscheduler
- Slack:https://join.slack.com/t/asf-dolphinscheduler/shared_invite/zt-1cmrxsio1-nJHxRJa44jfkrNL_Nsy9Qg
同样地,参与Apache DolphinScheduler 有非常多的参与贡献的方式,主要分为代码方式和非代码方式两种。
非代码方式包括:
完善文档、翻译文档;翻译技术性、实践性文章;投稿实践性、原理性文章;成为布道师;社区管理、答疑;会议分享;测试反馈;用户反馈等。
代码方式包括:
查找Bug;编写修复代码;开发新功能;提交代码贡献;参与代码审查等。
贡献第一个PR(文档、代码) 我们也希望是简单的,第一个PR用于熟悉提交的流程和社区协作以及感受社区的友好度。
社区汇总了以下适合新手的问题列表:https://github.com/apache/dolphinscheduler/pulls?q=is%3Apr+is%3Aopen+label%3A%22first+time+contributor%22优先级问题列表:https://github.com/apache/dolphinscheduler/pulls?q=is%3Apr+is%3Aopen+label%3Apriority%3Ahigh如何参与贡献链接:https://dolphinscheduler.apache.org/zh-cn/docs/3.2.2/%E8%B4%A1%E7%8C%AE%E6%8C%87%E5%8D%97_menu/%E5%A6%82%E4%BD%95%E5%8F%82%E4%B8%8E_menuhttps://github.com/apache/dolphinscheduler