环境准备
- MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)
- Git
- JDK: v1.8.x (Currently does not support jdk 11)
- Maven: v3.5+
- Node: v16.13+ (dolphinScheduler version is lower than 3.0, please install node v12.20+)
- Pnpm: v6.x
- Zookeeper: 3.8
1.克隆项目到本地
1 | git clone https://github.com/apache/dolphinscheduler.git |
2.导入项目到IDEA,并切换分支到3.1.0
1 | git checkout 3.1.0-release |
3.编译项目
spotless是一种代码格式化工具,使用 spotless:apply 表示格式化module代码
mvnw同mvn的功能是一样的,mvnw做了项目适配
1 | ./mvnw spotless:apply |
4.在mysql创建database数据库
1 | CREATE SCHEMA dolphinschedulertest; |
找到脚本dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql并运行
5.修改项目配置文件
全局搜索application.yaml
,将文件中涉及postgresql的替换为mysql
1 | driver-class-name: org.postgresql.Driver |
6.修改dolphinscheduler-bom下pom.xml
1 | <dependency> |
7.修改logback-spring.xml
全局搜索logback-spring.xml,将下面内容添加到其中
1 | <root level="INFO"> |
8.配置启动项
分别配置MasterServer, WorkerServer, ApiApplicationServer
- MasterServer:Execute function
main
in the classorg.apache.dolphinscheduler.server.master.MasterServer
by Intellij IDEA, with the configuration VM Options-Dlogging.config=classpath:logback-spring.xml -Ddruid.mysql.usePingMethod=false -Dspring.profiles.active=mysql
- WorkerServer:Execute function
main
in the classorg.apache.dolphinscheduler.server.worker.WorkerServer
by Intellij IDEA, with the configuration VM Options-Dlogging.config=classpath:logback-spring.xml -Ddruid.mysql.usePingMethod=false -Dspring.profiles.active=mysql
- ApiApplicationServer:Execute function
main
in the classorg.apache.dolphinscheduler.api.ApiApplicationServer
by Intellij IDEA, with the configuration VM Options-Dlogging.config=classpath:logback-spring.xml -Dspring.profiles.active=api,mysql
. After it started, you could find Open API documentation in http://localhost:12345/dolphinscheduler/swagger-ui/index.html
9.配置zookeeper
参考以前的博客zookeeper部署
10.启动前端
1 | pnpm install |
11.启动后端
分别在IDEA中运行MasterServer, WorkerServer, ApiApplicationServer
登陆账号密码 admin/dolphinscheduler123
参考文档:https://www.bookstack.cn/read/dolphinscheduler-3.1.0-en/af18cd17a04eb31f.md
编译错误1:
1 | [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:pnpm (pnpm install) on project dolphinscheduler-ui: Failed to run task: 'pnpm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 9 (Exit value: 9) -> [Help 1] |
解决办法:
修改dolphinscheduler-ui模块下的pom.xml,修改后记得重新执行./mvnw spotless:apply
格式化代码
1 | <!-- <plugins>--> |