当前位置: 首页 > news >正文

DolphinScheduler 3.2.0 后端开发环境搭建指南

目录

一、环境准备

二、源码获取

三、源码编译问题解决

四、关键配置修改

五、服务启动


一、环境准备
  1. 必需软件

    • JDK 8(必须使用 JDK 8)

    • Maven 3.6.0+(必须 ≥3.6.0

    • Git

    • MySQL 5.7+

  2. 版本验证

    java -version  # 必须显示 java version "1.8.x"
    mvn -v         # 必须显示 Apache Maven 3.6.0+
二、源码获取
  1. 克隆仓库并切换分支:

    git clone git@github.com:apache/dolphinscheduler.git
    cd dolphinscheduler
    git checkout 3.2.0  # 必须精确切换到3.2.0分支
三、源码编译问题解决
  1. 首次编译命令

    mvn clean install -Prelease -Dmaven.test.skip=true
  2. 问题1:Spotless格式检查失败 问题现象: 编译失败,控制台显示:

    [ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.27.2:check
    [ERROR] The following files had format violations:
    [ERROR]     pom.xml
    [ERROR]         @@ -15,7 +15,8 @@
    [ERROR]          ··~·See·the·License·for·the·specific·language·governing·permissions·and
    [ERROR]          ··~·limitations·under·the·License.
    [ERROR]          ··-->
    [ERROR]         -<project·xmlns="http://maven.apache.org/POM/4.0.0"·xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"·xsi:schemaLocation="http://maven.apache.org/POM/4.0.0·http://maven.apache.org/xsd/maven-4.0.0.xsd">
    [ERROR]         +<project·xmlns="http://maven.apache.org/POM/4.0.0"·xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    [ERROR]         +·········xsi:schemaLocation="http://maven.apache.org/POM/4.0.0·http://maven.apache.org/xsd/maven-4.0.0.xsd">

    问题原因pom.xml 文件的XML格式不符合规范,Spotless插件强制要求xsi:schemaLocation属性换行显示

    解决方案

    ./mvnw spotless:apply  # 自动修复格式问题
  3. 问题2:Maven版本不兼容 问题现象: 使用Maven 3.5.0编译时失败,控制台显示:

    [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:install-node-and-pnpm 
    [ERROR] The plugin com.github.eirslett:frontend-maven-plugin:1.12.1 requires Maven version 3.6.0

    问题原因: 前端编译插件frontend-maven-plugin强制要求Maven版本≥3.6.0

    解决方案: 升级Maven到3.6.0+版本

  4. 重新编译

    mvn clean install -Prelease -Dmaven.test.skip=true
四、关键配置修改
  1. MySQL驱动作用域修改 文件dolphinscheduler-bom/pom.xml 修改点

    <dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><!-- 将scope从test改为compile --><scope>compile</scope>
    </dependency>

    原因:确保编译时包含MySQL驱动

    紧接着创建dolphinscheduler数据库,并且dolphinscheduler/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sqlSQL文件直接在新创建的数据库中执行,初始化数据库。

  2. Master服务配置

    • 数据库配置dolphinscheduler-master/src/main/resources/application.yaml

      spring: datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/dolphinschedulerusername: rootpassword: mysql
    • 日志配置dolphinscheduler-master/src/main/resources/logback-spring.xml<root>节点内添加:

      <appender-ref ref="STDOUT"/>  <!-- 添加此行才能在控制台看到日志 -->
  3. Worker服务配置

    • 日志配置dolphinscheduler-worker/src/main/resources/logback-spring.xml 添加相同配置:

      <appender-ref ref="STDOUT"/>
  4. API服务配置

    • 数据库配置dolphinscheduler-api/src/main/resources/application.yaml

      spring: datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/dolphinschedulerusername: rootpassword: mysql
    • 日志配置dolphinscheduler-api/src/main/resources/logback-spring.xml 添加:

      <appender-ref ref="STDOUT"/>
五、服务启动
  1. 启动Master

    • 类路径:org.apache.dolphinscheduler.server.master.MasterServer

  2. 启动Worker

    • 类路径:org.apache.dolphinscheduler.server.worker.WorkerServer

  3. 启动API服务

    • 类路径:org.apache.dolphinscheduler.api.ApiApplicationServer


参考资料:DolphinScheduler环境搭建

http://www.dtcms.com/a/268333.html

相关文章:

  • XML 笔记
  • 极简的神经网络反向传播例子
  • 用户中心Vue3项目开发2.0
  • Docker 容器编排原理与使用详解
  • 125.【C语言】数据结构之归并排序递归解法
  • FileZilla二次开发实战指南:C++架构解析与界面功能扩展
  • 操作系统王道考研习题
  • 76、覆盖最小子串
  • 【STM32】通用定时器PWM
  • 漫漫数学之旅046
  • ThreadLocal的挑战与未来:在响应式编程与虚拟线程中的演变
  • ARMv8 创建3级页表示例
  • 【嵌入式电机控制#11】PID控制入门:对比例算法应用的深度理解
  • Python数据容器-str
  • ch03 部分题目思路
  • 数据驱动实时市场动态监测:让商业决策跑赢时间
  • 端到端矢量化地图构建与规划
  • Solidity——什么是selfdestruct
  • Java线程池知识点
  • RAG技术新格局:知识图谱赋能智能检索与生成
  • 【机器学习笔记Ⅰ】2 线性回归模型
  • 图灵完备之路(数电学习三分钟)----逻辑与计算架构
  • 在phpstudy环境下配置搭建XDEBUG配合PHPSTORM的调试环境
  • ESMFold 安装教程
  • 手动使用 Docker 启动 MinIO 分布式集群(推荐生产环境)
  • list和list中的注意事项
  • 三位一体:Ovis-U1如何以30亿参数重构多模态AI格局?
  • K8s系列之:Kubernetes 的 RBAC (Role-Based Access Control)
  • 定时器怎么玩?做个LED渐变灯练手
  • 【面板数据】全球贸易救济立案案件(1995-2024年)