System Requirements and Environment Setup
Before initiating the installation, ansure your host meets the following baseline requirements:
- Java Runtime Environment: Version 8 or higher
- Relational Database: MySQL 5.7 or later
- JDBC Driver: MySQL Connector/J 8.0.16+
1. Configure Java Environment
Obtain the JDK package and deploy it to a standardized directory. The following script automates directory creation, extraction, and system-wide path registration.
export RUNTIME_DIR=/usr/local/java
export JDK_ARCHIVE=jdk-8u401-linux-x64.tar.gz
mkdir -p "${RUNTIME_DIR}"
tar -zxf /tmp/"${JDK_ARCHIVE}" -C "${RUNTIME_DIR}"
JAVA_HOME_PATH=$(find "${RUNTIME_DIR}" -maxdepth 1 -type d -name "jdk1.8*" | head -n 1)
cat <<EOF | sudo tee -a /etc/profile.d/custom_java.sh
export JAVA_HOME=${JAVA_HOME_PATH}
export PATH=\${PATH}:\${JAVA_HOME}/bin
EOF
source /etc/profile.d/custom_java.sh
2. Prepare MySQL Instance
Install MySQL on your target node. Once the database engine is operational, proceed with the specific scheduler configuration steps.
Binary Deployment and Configuration
1. Retrieve and Extract Package
Fetch the official binary archive and unpack it into a dedicated application directory.
DS_RELEASE=https://archive.apache.org/dist/dolphinscheduler/3.1.4/apache-dolphinscheduler-3.1.4-bin.tar.gz
DEPLOY_BASE=/opt/ds_runtime
wget --no-check-certificate "${DS_RELEASE}" -P /tmp
mkdir -p "${DEPLOY_BASE}"
tar -zxf /tmp/apache-dolphinscheduler-3.1.4-bin.tar.gz -C "${DEPLOY_BASE}"
chmod +x ${DEPLOY_BASE}/*.sh 2>/dev/null || true
2. Update Environment Variables
Navigate to the extracted bin/env directory and edit dolphinscheduler_env.sh. Replace the default placeholders with your actual paths and credentials. The revised structure below isolates core runtime paths, database connectivity, and registry endpoints.
# Core Java Path
export JAVA_HOME=${JAVA_HOME:-/usr/local/java/jdk1.8.0_401}
# Database Connection Parameters
export DS_DATABASE=mysql
export SPRING_DATASOURCE_URL="jdbc:mysql://127.0.0.1:3306/dolphin_meta?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false"
export SPRING_DATASOURCE_USER="ds_operator"
export SPRING_DATASOURCE_PASS="SecurePass_2024!"
export SPRING_PROFILE_ACTIVE=mysqldb
# Registry & Cache Settings
export CACHE_IMPLEMENTATION=none
export JSON_TZ_SETTING=UTC
export COMMAND_FETCH_LIMIT=10
export REGISTRY_ENGINE=zookeeper
export ZK_CONNECTION_STR=localhost:2181
# External Tool Paths (Modify as needed)
export HADOOP_HOME=${HADOOP_HOME:-/opt/hadoop}
export SPARK_HOME=${SPARK_HOME:-/opt/spark}
export FLINK_HOME=${FLINK_HOME:-/opt/flink}
export PYTHON_EXECUTABLE=${PYTHON_HOME:-/usr/bin/python3}
# Append tool binaries to PATH
export PATH=\${HADOOP_HOME}/bin:\${SPARK_HOME}/bin:\${FLINK_HOME}/bin:\${JAVA_HOME}/bin:\${PATH}
3. Adjust Application Properties
Edit the standalone configuration file located at standalone-server/conf/application.yaml. Only modify the highlighted blocks to align with your MySQL setup and Zookeeper address. Ensure the driver class matches the connector version you downloaded.
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/dolphin_meta?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: ds_operator
password: SecurePass_2024!
type: com.alibaba.druid.pool.DruidDataSource
sql:
init:
schema-locations: classpath:sql/dolphin_scheduler_mysql.sql
registry:
type: zookeeper
zookeeper:
namespace: dolphin_ds
connect-string: localhost:2181
session-timeout: 30000
connection-timeout: 9000
server:
port: 12345
servlet:
context-path: /dolphinscheduler/
session:
timeout: 120m
security:
authentication:
type: PASSWORD
master:
listen-port: 5678
fetch-command-num: 10
host-selector: lower_weight
worker:
listen-port: 1234
tenant-auto-create: true
groups: [default]
python-gateway:
enabled: true
gateway-server-port: 25333
4. Database Schema Preparation
Before initializing the schema, adjust MySQL password validation policies to accommodate your chosen credentials, then create the target database and user account.
DB_ROOT_PASS="root_password"
DB_NAME="dolphin_meta"
DB_USER="ds_operator"
DB_PASS="SecurePass_2024!"
# Relax password validation
mysql -u root -p"${DB_ROOT_PASS}" -e "SET GLOBAL validate_password_length=4;"
mysql -u root -p"${DB_ROOT_PASS}" -e "SET GLOBAL validate_password_policy=LOW;"
# Verify and clean existing schema if present
if mysql -u root -p"${DB_ROOT_PASS}" -e "USE ${DB_NAME};" 2>/dev/null; then
mysql -u root -p"${DB_ROOT_PASS}" -e "DROP DATABASE IF EXISTS ${DB_NAME};"
fi
# Create fresh schema and user
mysql -u root -p"${DB_ROOT_PASS}" <<SQL
CREATE DATABASE ${DB_NAME} DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '${DB_PASS}';
GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%';
FLUSH PRIVILEGES;
SQL
Place the MySQL JDBC driver into all server component library directories:
CONNECTOR_URL=https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar
TARGET_LIBS=(${DEPLOY_BASE}/worker-server/libs
${DEPLOY_BASE}/api-server/libs
${DEPLOY_BASE}/alert-server/libs
${DEPLOY_BASE}/master-server/libs
${DEPLOY_BASE}/tools/libs
${DEPLOY_BASE}/standalone-server/libs/standalone-server)
wget "${CONNECTOR_URL}" -P /tmp
for lib_dir in "${TARGET_LIBS[@]}"; do
cp /tmp/mysql-connector-java-8.0.16.jar "${lib_dir}/"
done
5. Execute Schema Initialization
Run the database migration utility to populate the required tables:
cd "${DEPLOY_BASE}"
bash tools/bin/upgrade-schema.sh
Service Lifecycle Management
1. Launch Standalone Instance
Start the unified server process using the daemon script. The system will sequentially bootstrap the API, Master, Worker, and Alert services.
cd "${DEPLOY_BASE}"
./bin/dolphinscheduler-daemon.sh start standalone-server
Once the console output indicates successful binding, navigate to http://<server-ip>:12345/dolphinscheduler/ui in your web browser. Use the default credentials admin / dolphinscheduler123 to access the dashboard.
2. Operational Control Commands
Use the following commands to manage the scheduler process during routine operations:
# Start the service
./bin/dolphinscheduler-daemon.sh start standalone-server
# Gracefully stop the service
./bin/dolphinscheduler-daemon.sh stop standalone-server
# Perform a clean restart
./bin/dolphinscheduler-daemon.sh stop standalone-server && sleep 2
./bin/dolphinscheduler-daemon.sh start standalone-server