This article is intended for developers who want to read and debug the core source code of Apache DolphinScheduler locally. The example environment is based on Windows + IntelliJ IDEA + Docker Desktop + PostgreSQL + ZooKeeper.
If you only want to quickly تجربه features rather than debug the full chain of master / worker / api, it is recommended to use StandaloneServer first. If you want to debug the distributed scheduling workflow, follow this guide to start services separately.
Use Cases
- Start
MasterServer,WorkerServer, andApiApplicationServerindividually in IntelliJ IDEA - Use Docker Desktop to host PostgreSQL and ZooKeeper
- Debug Java services locally on the host machine
- Run the frontend locally and connect it to backend APIs
Environment Requirements
- Docker Desktop
- JDK 8 or 11
- Maven 3.8+ (or use the built-in
mvnw.cmd) - Node.js 16+
- pnpm 8+
- IntelliJ IDEA
The
java.versionin the rootpom.xmlis1.8. It is recommended to use JDK 8 or 11 for local debugging.
1. Start PostgreSQL and ZooKeeper
First, navigate to the deploy/docker directory:
cd <your-path>\dolphinscheduler\deploy\docker
If you are using the docker-compose-windows.yml provided in the appendix, ensure that dolphinscheduler-zookeeper exposes port 2181.
master, worker, and api all connect to localhost:2181 by default. If ZooKeeper runs only inside the container without port mapping, Java processes started in IDEA will fail to connect.
Ensure the following configuration exists:
dolphinscheduler-zookeeper:
image: zookeeper:3.8
ports:
- "2181:2181"
Start services:
docker-compose -f docker-compose-windows.yml up -d dolphinscheduler-postgresql dolphinscheduler-zookeeper
Optional verification:
docker ps
Test-NetConnection 127.0.0.1 -Port 5432
Test-NetConnection localhost -Port 2181
Expected results:
- Port
5432is reachable - Port
2181is reachable
If you are using local or remote installations instead of Docker, skip this step but ensure configurations match your environment.
2. Build the Project
cd <your-path>\dolphinscheduler
.\mvnw.cmd spotless:apply
.\mvnw.cmd clean install -DskipTests
Notes:
-
spotless:applyformats code to avoid check failures - The first build may take a while
3. Initialize PostgreSQL Metadata Database
Before starting master and api, initialize metadata tables.
SQL script location:
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
Using Docker PostgreSQL:
Get-Content -Path .\dolphinscheduler-dao\src\main\resources\sql\dolphinscheduler_postgresql.sql -Raw |
docker exec -i -e PGPASSWORD=root docker-dolphinscheduler-postgresql-1 psql -U root -d dolphinscheduler
Alternatively, use DataGrip, DBeaver, or psql.
Note: This script contains
DROP TABLE IF EXISTS. Do NOT run it on production databases.
Verification:
select version from t_ds_version;
Expected: one record returned (e.g., 3.4.0)
4. Verify Local Configuration
Default configs (usually no changes needed):
- PostgreSQL:
127.0.0.1:5432 - DB:
dolphinscheduler - Username:
root - Password:
root - ZooKeeper:
localhost:2181
Config files:
dolphinscheduler-master/.../application.yamldolphinscheduler-api/.../application.yamldolphinscheduler-worker/.../application.yaml
If needed, modify:
spring.datasource.urlspring.datasource.usernamespring.datasource.passwordregistry.zookeeper.connect-string
Do NOT use:
-Dspring.profiles.active=mysql
Use instead:
-Dspring.profiles.active=postgresql
5. Configure IntelliJ IDEA Run Configurations
Common settings:
- JDK: 8 or 11
- Use the classpath of the module
- Enable:
Add dependencies with "provided" scope to classpath - Working directory: project root
This option is critical to avoid missing dependency issues.
Create these configurations:
MasterServer
- Main class:
org.apache.dolphinscheduler.server.master.MasterServer
Ports:
- RPC: 5678
- Spring Boot: 5679
WorkerServer
- Main class:
org.apache.dolphinscheduler.server.worker.WorkerServer
Ports:
- RPC: 1234
- Spring Boot: 1235
ApiApplicationServer
- Main class:
org.apache.dolphinscheduler.api.ApiApplicationServer
Ports:
- HTTP: 12345
- Gateway: 25333
Startup order:
- MasterServer
- WorkerServer
- ApiApplicationServer
6. Start Frontend
cd <your-path>\dolphinscheduler\dolphinscheduler-ui
pnpm install
pnpm run dev
Access:
http://localhost:5173
Default credentials:
- Username:
admin - Password:
dolphinscheduler123
7. Verification
API
-
/actuator/health→ should returnUP -
/swagger-ui→ should load successfully
Frontend
- Access UI and log in successfully
Logs
Check for fatal errors in the IDEA console
8. Common Issues
ZooKeeper connection failed
- ZooKeeper is not running
- Port 2181 not exposed
Missing t_ds_version table
- DB not initialized
- Wrong database
Missing dependencies in IDEA
- Check the “provided scope” option
Port 12345 occupied
- Stop conflicting processes

Top comments (0)