DolphinScheduler Developer Must-Read! IDEA Local Debugging Practical Guide

This article systematically outlines the general process for setting up a local debugging environment for Apache DolphinScheduler in IDEA, including environment preparation, code configuration, service startup, and other core steps for reference. 1. Basic Component Preparation 1. JDK: v1.8.x (currently does not support JDK 11) 2. Maven: v3.5+ 3. Node.js: v18.19.1+, install pnpm // Global installation npm install pnpm -g // Check registry pnpm config get registry // Switch to Taobao registry pnpm config set registry https://registry.npmmirror.com/ 4. Zookeeper: 3.6.3 (this version is used by big data platforms, DS reuses the platform's Zookeeper). When using the latest DS, it uses curator 5.3.0 Curator 5.0 supports Zookeeper 3.6.X, no longer supports Zookeeper 3.4.X Curator 4.X supports Zookeeper 3.5.X, with soft compatibility for 3.4.X Curator 2.X supports Zookeeper 3.4.X 5. MySQL version check: mysql> select version(); +-----------+ | version() | +-----------+ | 5.7.44 | +-----------+ 1 row in set (0.00 sec) 2. Initialization 2.1 Initialize Database source /Users/xxx/IdeaProjects/dolphinscheduler/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql; 2.2 Key Configurations in common.properties # Local directory for storing scripts data.basedir.path=/tmp/dolphinscheduler # Storage medium selection (e.g., HDFS); for resource center and tenant directories resource.storage.type=HDFS # Root directory of resource center resource.storage.upload.base.path=/dolphinscheduler # User for HDFS operations (typically hdfs user) resource.hdfs.root.user=hdfs # HDFS defaultFS (for HA mode, place core-site.xml and hdfs-site.xml in resources folder) resource.hdfs.fs.defaultFS=hdfs://10.253.26.85:8020 # Development mode (recommended for easier troubleshooting) development.state=true # YARN port resource.manager.httpaddress.port=8088 # For YARN HA, configure multiple IPs separated by commas yarn.resourcemanager.ha.rm.ids= # For single YARN, replace ds1 with YARN IP; leave unchanged for HA mode yarn.application.status.address=http://ds1:%s/ws/v1/cluster/apps/%s 2.3 Configure application.yaml for Each Service Note: Mainly configure Zookeeper connection address and MySQL address (details omitted). 2.4 Configure logback-spring.xml for Each Service Set for console output. Here's the line-by-line English translation: 3. Component Startup 1) MasterServer: Execute the main method of org.apache.dolphinscheduler.server.master.MasterServer in IntelliJ IDEA, with VM Options: -Dlogging.config=classpath:logback-spring.xml -Ddruid.mysql.usePingMethod=false -Dspring.profiles.active=mysql 2) WorkerServer: Execute the main method of org.apache.dolphinscheduler.server.worker.WorkerServer in IntelliJ IDEA, with VM Options: -Dlogging.config=classpath:logback-spring.xml -Ddruid.mysql.usePingMethod=false -Dspring.profiles.active=mysql 3) ApiApplicationServer: Execute the main method of org.apache.dolphinscheduler.api.ApiApplicationServer in IntelliJ IDEA, with VM Options: -Dlogging.config=classpath:logback-spring.xml -Dspring.profiles.active=api,mysql After startup, you can browse OpenAPI documentation at: http://localhost:12345/dolphinscheduler/swagger-ui/index.html 4) Frontend: cd dolphinscheduler-ui pnpm install pnpm run dev Error encountered: qiaozhanwei@ dolphinscheduler-ui % pnpm run dev > dolphinscheduler-ui@0.0.0 dev /Users/qiaozhanwei/IdeaProjects/dolphinscheduler/dolphinscheduler-ui > vite error when starting dev server: Error: listen EADDRNOTAVAIL: address not available 192.168.1.4:5173 at Server.setupListenHandle [as _listen2] (node:net:1313:21) at listenInCluster (node:net:1378:12) at GetAddrInfoReqWrap.doListen [as callback] (node:net:1516:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8) Code modification: On Mac, find IP address in terminal using command: ipconfig getifaddr en0 After finding IP address, locate vite.config.ts file in project and modify as follows: import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], base:'/', server:{ host:'192.168.x.x', port:'5173', https:'false', open:'true', hmr:{ protocol:'ws', host:'192.168.x.x' }, } }) Login URL: http://10.x.x.x/login Use credentials admin/dolphinscheduler123 to login 4. Version 2.x Component Startup api server: -Dlogging.config=classpath.logback-api.xml -Ddruid.mysql.usePingMethod=false -Dspring.profiles.active="default,api,mysql" master: -Dlogging.config=classpath.logback-master.xml -Ddruid.mysql.usePingMethod=false -Dspring.profiles.active="default,master,mysql" worker: -Dlogging.config=classpath.lo

Apr 23, 2025 - 03:55
 0
DolphinScheduler Developer Must-Read! IDEA Local Debugging Practical Guide

This article systematically outlines the general process for setting up a local debugging environment for Apache DolphinScheduler in IDEA, including environment preparation, code configuration, service startup, and other core steps for reference.

1. Basic Component Preparation

1. JDK: v1.8.x (currently does not support JDK 11)  
2. Maven: v3.5+  
3. Node.js: v18.19.1+, install pnpm  
// Global installation  
npm install pnpm -g  
// Check registry  
pnpm config get registry  
// Switch to Taobao registry  
pnpm config set registry https://registry.npmmirror.com/  

4. Zookeeper: 3.6.3 (this version is used by big data platforms, DS reuses the platform's Zookeeper). When using the latest DS, it uses curator 5.3.0  
Curator 5.0 supports Zookeeper 3.6.X, no longer supports Zookeeper 3.4.X  
Curator 4.X supports Zookeeper 3.5.X, with soft compatibility for 3.4.X  
Curator 2.X supports Zookeeper 3.4.X  

5. MySQL version check:  
mysql> select version();  
+-----------+  
| version() |  
+-----------+  
| 5.7.44    |  
+-----------+  
1 row in set (0.00 sec)  

2. Initialization

2.1 Initialize Database

source /Users/xxx/IdeaProjects/dolphinscheduler/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql;  

Image description

2.2 Key Configurations in common.properties

# Local directory for storing scripts  
data.basedir.path=/tmp/dolphinscheduler  

# Storage medium selection (e.g., HDFS); for resource center and tenant directories  
resource.storage.type=HDFS  

# Root directory of resource center  
resource.storage.upload.base.path=/dolphinscheduler  

# User for HDFS operations (typically hdfs user)  
resource.hdfs.root.user=hdfs  

# HDFS defaultFS (for HA mode, place core-site.xml and hdfs-site.xml in resources folder)  
resource.hdfs.fs.defaultFS=hdfs://10.253.26.85:8020  

# Development mode (recommended for easier troubleshooting)  
development.state=true  

# YARN port  
resource.manager.httpaddress.port=8088  

# For YARN HA, configure multiple IPs separated by commas  
yarn.resourcemanager.ha.rm.ids=  

# For single YARN, replace ds1 with YARN IP; leave unchanged for HA mode  
yarn.application.status.address=http://ds1:%s/ws/v1/cluster/apps/%s  

2.3 Configure application.yaml for Each Service

Note: Mainly configure Zookeeper connection address and MySQL address (details omitted).

2.4 Configure logback-spring.xml for Each Service

Set for console output.

Here's the line-by-line English translation:

3. Component Startup

1) MasterServer:
Execute the main method of org.apache.dolphinscheduler.server.master.MasterServer in IntelliJ IDEA,
with VM Options:
-Dlogging.config=classpath:logback-spring.xml 
-Ddruid.mysql.usePingMethod=false 
-Dspring.profiles.active=mysql

2) WorkerServer:
Execute the main method of org.apache.dolphinscheduler.server.worker.WorkerServer in IntelliJ IDEA,
with VM Options:
-Dlogging.config=classpath:logback-spring.xml 
-Ddruid.mysql.usePingMethod=false 
-Dspring.profiles.active=mysql

3) ApiApplicationServer:
Execute the main method of org.apache.dolphinscheduler.api.ApiApplicationServer in IntelliJ IDEA,
with VM Options:
-Dlogging.config=classpath:logback-spring.xml 
-Dspring.profiles.active=api,mysql

After startup, you can browse OpenAPI documentation at:
http://localhost:12345/dolphinscheduler/swagger-ui/index.html

4) Frontend:
cd dolphinscheduler-ui
pnpm install
pnpm run dev

Error encountered:
qiaozhanwei@ dolphinscheduler-ui % pnpm run dev
> dolphinscheduler-ui@0.0.0 dev /Users/qiaozhanwei/IdeaProjects/dolphinscheduler/dolphinscheduler-ui 
> vite

error when starting dev server:
Error: listen EADDRNOTAVAIL: address not available 192.168.1.4:5173
    at Server.setupListenHandle [as _listen2] (node:net:1313:21)
    at listenInCluster (node:net:1378:12)
    at GetAddrInfoReqWrap.doListen [as callback] (node:net:1516:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8)

Code modification:
On Mac, find IP address in terminal using command:
ipconfig getifaddr en0

After finding IP address, locate vite.config.ts file in project and modify as follows:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    base:'/',
    server:{
        host:'192.168.x.x',
        port:'5173',
        https:'false',
        open:'true',
        hmr:{
            protocol:'ws',
            host:'192.168.x.x'
        },
    }
})

Login URL:
http://10.x.x.x/login 
Use credentials admin/dolphinscheduler123 to login

4. Version 2.x Component Startup

api server:
-Dlogging.config=classpath.logback-api.xml 
-Ddruid.mysql.usePingMethod=false 
-Dspring.profiles.active="default,api,mysql"

master:
-Dlogging.config=classpath.logback-master.xml 
-Ddruid.mysql.usePingMethod=false 
-Dspring.profiles.active="default,master,mysql"

worker:
-Dlogging.config=classpath.logback-worker.xml 
[Note:The worker configuration appears to be truncated in original text]