设计特点: 一个分布式易扩展的可视化DAG工作流任务调度系统。致力于解决数据处理流程中错综复杂的依赖关系,使调度系统在数据处理流程中开箱即用
。 其主要目标如下:
- 以DAG图的方式将Task按照任务的依赖关系关联起来,可实时可视化监控任务的运行状态
- 支持丰富的任务类型:Shell、MR、Spark、SQL(mysql、postgresql、hive、sparksql),Python,Sub_Process、Procedure等
- 支持工作流定时调度、依赖调度、手动调度、手动暂停/停止/恢复,同时支持失败重试/告警、从指定节点恢复失败、Kill任务等操作
- 支持工作流优先级、任务优先级及任务的故障转移及任务超时告警/失败
- 支持工作流全局参数及节点自定义参数设置
- 支持资源文件的在线上传/下载,管理等,支持在线文件创建、编辑
- 支持任务日志在线查看及滚动、在线下载日志等
- 实现集群HA,通过Zookeeper实现Master集群和Worker集群去中心化
- 支持对
Master/Worker
cpu load,memory,cpu在线查看 - 支持工作流运行历史树形/甘特图展示、支持任务状态统计、流程状态统计
- 支持补数
- 支持多租户
- 支持国际化
- 还有更多等待伙伴们探索
1.基础环境
- PostgreSQL (8.2.15+) or Mysql (5.5+) : 两者任选其一即可
- JDK (1.8+) : 必装
- ZooKeeper (3.4.6+) :必装
- Hadoop (2.6+) or MinIo :选装, 如果需要使用到资源上传功能,可以选择Hadoop or MinIo
- Hive(1.2.1) : 选装,hive任务提交需要安装
- Spark (1.x,2.x) : 选装,Spark任务提交需要安装
2. 下载
git clone https://github.com/apache/incubator-dolphinscheduler.git -b 1.2.1.release
3.修改 pom.xml 文件 [采用 mysql 数据库 ]
去掉mysql 中的 scope 依赖.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
<!--<scope>test</scope>-->
</dependency>
4.修改配置
4.1. apache-dolphinscheduler-1.2.1-src/dolphinscheduler-dao/src/main/resources/application.properties
# base spring data source configuration
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
# postgre
#spring.datasource.driver-class-name=org.postgresql.Driver
#spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler
# mysql
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=xxxx
spring.datasource.password=xxxx
4.2. apache-dolphinscheduler-1.2.1-src/dolphinscheduler-common/src/main/resources/quartz.properties
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.dataSource.myDs.driver = com.mysql.jdbc.Driver
#org.quartz.dataSource.myDs.driver = org.postgresql.Driver
org.quartz.dataSource.myDs.URL = jdbc:mysql://localhost:3306/dolphinscheduler?characterEncoding=utf8
#org.quartz.dataSource.myDs.URL = jdbc:postgresql://localhost:5432/dolphinscheduler?characterEncoding=utf8
org.quartz.dataSource.myDs.user = xxxx
org.quartz.dataSource.myDs.password = xxxx
4.3./workspace/apache-dolphinscheduler-1.2.1-src/dolphinscheduler-common/src/main/resources/common.properties
#zookeeper cluster. multiple are separated by commas. eg. 192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181
zookeeper.quorum=localhost:2181
5.编译后端
进入项目根目录,执行命令
mvn -U -X clean package -Prelease -Dmaven.test.skip=true
6.编译前端
cd apache-dolphinscheduler-1.2.1-src/dolphinscheduler-ui
npm install node-sass --unsafe-perm
npm install [ 慢的话用这个 npm install --registry https://registry.npm.taobao.org]
修改配置
/workspace/apache-dolphinscheduler-1.2.1-src/dolphinscheduler-ui/.env
# back end interface address API_BASE = http://127.0.0.1:12345 # If IP access is required for local development, remove the "#" DEV_HOST = 127.0.0.1
启动
npm run dev
7. 创建&初始化数据库
创建数据库
CREATE DATABASE escheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON escheduler.* TO '{user}'@'%' IDENTIFIED BY '{password}';
GRANT ALL PRIVILEGES ON escheduler.* TO '{user}'@'localhost' IDENTIFIED BY '{password}';
flush privileges;
运行
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/shell/CreateDolphinScheduler.java
8.导入项目到 idea
9.启动类
运行:
org.apache.dolphinscheduler.server.master.MasterServer
org.apache.dolphinscheduler.server.worker.WorkerServer
org.apache.dolphinscheduler.api.CombinedApplicationServer
启动CombinedApplicationServer的时候需要设置一下配置文件
10.观看效果
admin/escheduler123
参考: