普元数据开发平台 普元数据开发平台
产品介绍
安装部署
快速入门
操作指南
应用集成
FAQ
  • Standalone 版安装
  • 1. 介质目录结构说明
  • 2. 安装前准备
  • 2.1 请确保机器已配置 JDK 1.8.0_251 及以上
  • 2.2 创建免密用户、配置用户免密及权限
  • 2.3 配置机器SSH免密登陆
  • 3. 解压介质
  • 4. 初始化数据库脚本
  • 5. 修改 nginx.conf 配置
  • 6. 一键启动/停止服务
  • 7. 访问地址
  • 8. 其他参考
  • 8.1 端口号
  • 8.2 修改数据库的连接配置、服务的 IP 地址
  • 8.3 开启 DWS 血缘分析()
  • 8.4 dolphin 对接分布式或远端对象存储()
  • 8.5 dolphinscheduler_env.sh环境变量配置说明

# Standalone 版安装

独立版(Standalone)安装无需像微服务版(MicroApp)那样进行各种环境准备,只要准备好可以连通使用的数据库即可。

具体步骤如下:

  1. 介质目录结构说明
  2. 安装前准备
  3. 解压介质
  4. 初始化数据库脚本
  5. 修改 nginx.conf 配置
  6. 一键启动/停止服务
  7. 访问地址
  8. 其他参考

# 1. 介质目录结构说明

Primeton_DWS_Standalone_7.1.0.tar.gz 目录结构说明:    ├── server    │   ├── dolphin # ~ DolphinScheduler 调度引擎    │   ├── dws # ~ dws server 所在目录    │   ├── primeton-di # ~ 数据加工作业执行引擎    │   └── seatunnel # ~ 数据同步作业执行引擎    ├── web # ~ 前端资源和nginx配置文件    │   ├── afcenter # ~ 前端文件    │   └── conf # ~ dws server 所在目录         └── dws.conf # ~ nginx配置文件示例    ├── shutdown.sh # ~ 一键启动脚本    └── startup.sh # ~ 一键停止脚本

# 2. 安装前准备

# 2.1 请确保机器已配置 JDK 1.8.0_251 及以上

# 2.2 创建免密用户、配置用户免密及权限

创建用户 dws,并且一定要配置 sudo 免密,产品默认用 dws 用户来运行。

# 创建用户需使用 root 登录
useradd dws

# 添加密码
echo "dws" | passwd --stdin dws

# 配置 sudo 免密
sed -i '$adws  ALL=(ALL)  NOPASSWD: NOPASSWD: ALL' /etc/sudoers
sed -i 's/Defaults    requirett/#Defaults    requirett/g' /etc/sudoers

注意:因为任务执行服务是以 sudo -u {linux-user} 切换不同 linux 用户的方式来实现多租户运行作业,所以部署用户需要有 sudo 权限。

# 2.3 配置机器SSH免密登陆

由于安装的时候需要向不同机器发送资源,所以要求各台机器间能实现SSH免密登陆。配置免密登陆的步骤如下:

su dws

ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

注意: 配置完成后,可以通过运行命令 ssh localhost 判断是否成功,如果不需要输入密码就能 ssh 登陆则证明成功。

# 3. 解压介质

#切换 root 用户 su root

#将DWS Standalone介质解压到/home/dws目录下 tar -zxvf Primeton_DWS_Standalone_7.1.0.tar.gz -C /home/dws

#将目录权限赋予 dws 用户 chown -R dws:dws /home/dws

# 4. 初始化数据库脚本

MySQL 数据库需要设置为大小写不敏感,即: lower_case_table_names=1

本说明以 MySQL 数据库为例:

  • 创建 DWS 数据库:dws,执行数据库初始化脚本

    • 使用all脚本执行:

      server/dws/db-scripts/all/Mysql/all.sql
      
    • 若使用分开的脚本,则需要依次执行以下脚本:

      server/dws/db-scripts/single/eos/Mysql/all.sql
      server/dws/db-scripts/single/afcenter/Mysql/all.sql
      server/dws/db-scripts/single/pubres/Mysql/all.sql
      server/dws/db-scripts/single/dws/Mysql/all.sql
      server/dws/db-scripts/single/dwsStandalone/Mysql/04-afc-disable-features.sql
      
  • 创建 dolphin 数据库:dolphinscheduler,执行数据库初始化脚本

server/dolphin/standalone-server/conf/sql/dolphinscheduler_mysql.sql

提示:数据库配置默认用户名是 root,密码是 primeton,如果与上述示例的数据库名称、用户名、密码不一致,请参考 7.2 配置参考 修改 DWS 数据库配置、修改 dolphin 数据库配置。

# 5. 修改 nginx.conf 配置

Nginx安装请参考Nginx安装指南

将 web/conf/dws.conf 文件拷贝至 nginx 目录下,并修改 dws 前端资源路径,请参考如下配置:

    # a part of nginx configuration e.g.
    # nginx.conf should include the file

    # DWS/AFCenter standalone servers
    upstream afcenter {
        server 127.0.0.1:11110; 
    }

    server {
        listen 80;

        charset utf-8;
        client_max_body_size 200M;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Real-Port $remote_port;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1";
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-Permitted-Cross-Domain-Policies "master-only";
        add_header X-Download-Options noopen;
        add_header Content-Security-Policy "script-src * 'unsafe-inline' 'unsafe-eval'";
        add_header Strict-Transport-Security "max-age=SECONDS";
        add_header Referrer-Policy "no-referrer" always;

        location / {
            # change to your web resource folder ${DWS_SERVER_HOME}/static, or copy to here: /usr/share/nginx/afcenter
            root /usr/share/nginx/afcenter;
            index index.html index.htm;
            try_files $uri /index.html;
        }

        # if afcenter web-ui express mode enabled
        # all API request forward to one server (only one API route)
        location ^~/api/ {
            proxy_pass http://afcenter;
        }

        #location ~ \.biz\.ext$ {
        #    proxy_pass http://afcenter;
        # }
        # ...
    }

# 6. 一键启动/停止服务

一键启动/停止会将所有服务启动/停止。

 #切换 dws 用户
 su dws
 
 #启动服务
 ./startup.sh
 #切换 dws 用户
 su dws

 #停止服务
 ./shutdown.sh

如果需要单独启动某个服务,参考如下命名:

  • 启动/停止 dolphin 服务
 #启动服务
 ./startup.sh dolphin
 #停止服务
 ./shutdown.sh dolphin
  • 启动/停止 seatunnel 服务
 #启动服务
 ./startup.sh seatunnel
 #停止服务
 ./shutdown.sh seatunnel
  • 启动/停止 DI 服务
 #启动服务
 ./startup.sh di
 #停止服务
 ./shutdown.sh di
  • 启动/停止 dws 服务
 #启动服务
 ./startup.sh dws
 #停止服务
 ./shutdown.sh dws

# 7. 访问地址

 http://localhost:80
 默认账号/密码:admin/000000

# 8. 其他参考

如果用户需要修改介质中默认的配置值,可以参考如下章节内容进行修改。

# 8.1 端口号

dolphin master dolphin worker dolphin alert dws nginx
5678 1234 50052 11110 80

# 8.2 修改数据库的连接配置、服务的 IP 地址

  • 修改 server/dws/config/DWS/config/user-config.xml

修改文件中的数据库配置信息,即初始化脚本所用的数据库。

MySQL:

<group name="default">
    <configValue key="Database-Type">MySql</configValue>
    <configValue key="Jdbc-Type"/>
    <configValue key="C3p0-DriverClass">com.mysql.jdbc.Driver</configValue>
    <configValue key="C3p0-Url">jdbc:mysql://127.0.0.1:3306/dws?characterEncoding=utf-8&amp;serverTimezone=Asia/Shanghai</configValue>
    <configValue key="C3p0-UserName">root</configValue>
    <configValue key="C3p0-Password">primeton</configValue>
    <configValue key="C3p0-PoolSize">10</configValue>
    <configValue key="C3p0-MaxPoolSize">50</configValue>
    <configValue key="C3p0-MinPoolSize">10</configValue>
    <!-- //seconds, 0 means connections never expire -->
    <configValue key="C3p0-MaxIdleTime">600</configValue>
    <!-- //idle connections never tested -->
    <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
    <configValue key="C3p0-MaxStatements">0</configValue>
    <configValue key="C3p0-NumHelperThreads">1</configValue>

    <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
    <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
    <configValue key="Retry-Connect-Count">-1</configValue>
</group>

Oracle:

<group name="default">
            <configValue key="Database-Type">Oracle</configValue>
            <configValue key="Jdbc-Type"/>
            <configValue key="C3p0-DriverClass">oracle.jdbc.OracleDriver</configValue>
            <configValue key="C3p0-Url">jdbc:oracle:thin:@127.0.0.1:1521:orcl</configValue>
            <configValue key="C3p0-UserName">C##DWS_INIT</configValue>
            <configValue key="C3p0-Password">primeton</configValue>
            <configValue key="C3p0-PoolSize">10</configValue>
            <configValue key="C3p0-MaxPoolSize">50</configValue>
            <configValue key="C3p0-MinPoolSize">10</configValue>
            <!-- //seconds, 0 means connections never expire -->
            <configValue key="C3p0-MaxIdleTime">600</configValue>
            <!-- //idle connections never tested -->
            <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
            <configValue key="C3p0-MaxStatements">0</configValue>
            <configValue key="C3p0-NumHelperThreads">1</configValue>
            <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
            <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
            <configValue key="Retry-Connect-Count">-1</configValue>
  </group>

PostgreSQL: url连接中必须增加参数 ?stringtype=unspecified

 <group name="default">
            <configValue key="Database-Type">postgresql</configValue>
            <configValue key="Jdbc-Type"/>
            <configValue key="C3p0-DriverClass">org.postgresql.Driver</configValue>
            <configValue key="C3p0-Url">jdbc:postgresql://127.0.0.1:5432/dws7la_test?stringtype=unspecified</configValue>
            <configValue key="C3p0-UserName">dws7la_test</configValue>
            <configValue key="C3p0-Password">primeton</configValue>
            <configValue key="C3p0-PoolSize">10</configValue>
            <configValue key="C3p0-MaxPoolSize">50</configValue>
            <configValue key="C3p0-MinPoolSize">10</configValue>
            <!-- //seconds, 0 means connections never expire -->
            <configValue key="C3p0-MaxIdleTime">600</configValue>
            <!-- //idle connections never tested -->
            <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
            <configValue key="C3p0-MaxStatements">0</configValue>
            <configValue key="C3p0-NumHelperThreads">1</configValue>
            <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
            <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
            <configValue key="Retry-Connect-Count">-1</configValue>
  </group>

DM:

 <group name="default">
            <configValue key="Database-Type">DM</configValue>
            <configValue key="Jdbc-Type"/>
            <configValue key="C3p0-DriverClass">dm.jdbc.driver.DmDriver</configValue>
            <configValue key="C3p0-Url">jdbc:dm://127.0.0.1:5236/DWSV7LA</configValue>
            <configValue key="C3p0-UserName">DWSV7LA</configValue>
            <configValue key="C3p0-Password">primeton</configValue>
            <configValue key="C3p0-PoolSize">10</configValue>
            <configValue key="C3p0-MaxPoolSize">50</configValue>
            <configValue key="C3p0-MinPoolSize">10</configValue>
            <!-- //seconds, 0 means connections never expire -->
            <configValue key="C3p0-MaxIdleTime">600</configValue>
            <!-- //idle connections never tested -->
            <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
            <configValue key="C3p0-MaxStatements">0</configValue>
            <configValue key="C3p0-NumHelperThreads">1</configValue>
            <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
            <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
            <configValue key="Retry-Connect-Count">-1</configValue>
  </group>

openGauss:

 <group name="default">
            <configValue key="Database-Type">gaussDB</configValue>
            <configValue key="Jdbc-Type"/>
            <configValue key="C3p0-DriverClass">org.opengauss.Driver</configValue>
            <configValue key="C3p0-Url">jdbc:opengauss://127.0.0.1:15432/dws7_test</configValue>
            <configValue key="C3p0-UserName">gaussdb</configValue>
            <configValue key="C3p0-Password">primeton</configValue>
            <configValue key="C3p0-PoolSize">10</configValue>
            <configValue key="C3p0-MaxPoolSize">50</configValue>
            <configValue key="C3p0-MinPoolSize">10</configValue>
            <!-- //seconds, 0 means connections never expire -->
            <configValue key="C3p0-MaxIdleTime">600</configValue>
            <!-- //idle connections never tested -->
            <configValue key="C3p0-IdleConnectionTestPeriod">900</configValue>
            <configValue key="C3p0-MaxStatements">0</configValue>
            <configValue key="C3p0-NumHelperThreads">1</configValue>
            <configValue key="Transaction-Isolation">ISOLATION_DEFAULT</configValue>
            <configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE</configValue>
            <configValue key="Retry-Connect-Count">-1</configValue>
  </group>

Sqlserver:

&lt;group name="default">
            &lt;configValue key="Database-Type">SqlServer&lt;/configValue>
            &lt;configValue key="Jdbc-Type"/>
            &lt;configValue key="C3p0-DriverClass">com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/configValue>
            &lt;configValue key="C3p0-Url">jdbc:sqlserver://127.0.0.1:1433;databaseName=dws7;trustServerCertificate=true&lt;/configValue>
            &lt;configValue key="C3p0-UserName">dws7&lt;/configValue>
            &lt;configValue key="C3p0-Password">primeton&lt;/configValue>
            &lt;configValue key="C3p0-PoolSize">10&lt;/configValue>
            &lt;configValue key="C3p0-MaxPoolSize">50&lt;/configValue>
            &lt;configValue key="C3p0-MinPoolSize">10&lt;/configValue>
            &lt;!-- //seconds, 0 means connections never expire -->
            &lt;configValue key="C3p0-MaxIdleTime">600&lt;/configValue>
            &lt;!-- //idle connections never tested -->
            &lt;configValue key="C3p0-IdleConnectionTestPeriod">900&lt;/configValue>
            &lt;configValue key="C3p0-MaxStatements">0&lt;/configValue>
            &lt;configValue key="C3p0-NumHelperThreads">1&lt;/configValue>
            &lt;configValue key="Transaction-Isolation">ISOLATION_DEFAULT&lt;/configValue>
            &lt;configValue key="Test-Connect-Sql">SELECT count(*) from EOS_UNIQUE_TABLE&lt;/configValue>
            &lt;configValue key="Retry-Connect-Count">-1&lt;/configValue>
        &lt;/group>
  • 修改 dolphin 数据库配置、JDK 配置:server/dolphin/bin/env/dolphinscheduler_env.sh
(略)
# JAVA_HOME, will use it to start DolphinScheduler server
export JAVA_HOME=${JAVA_HOME:-/opt/java/openjdk}

# Database related configuration, set database type, username and password
#DATABASE目前支持 mysql,DM,postgresql,gaussDB,oracle
export DATABASE=${DATABASE:-mysql}
export SPRING_PROFILES_ACTIVE=${DATABASE}
export SPRING_DATASOURCE_URL="jdbc:mysql://127.0.0.1:3306/dolphinscheduler?serverTimezone=Asia/Shanghai&useSSL=false"
export SPRING_DATASOURCE_USERNAME="root"
export SPRING_DATASOURCE_PASSWORD="primeton"
(略)

若使用PostgreSQL数据库,SPRING_DATASOURCE_URL参数中的url需要配置参数:stringtype=unspecified。否则运行作业时会报错,参考如下配置:

#数据库使用PostgreSQL时的配置
export SPRING_DATASOURCE_URL="jdbc:postgresql://127.0.0.1:5432/dolphin_dev?stringtype=unspecified"
  • 修改 DWS 服务 IP 及端口:server/config/application.properties
(略)
server.port=11110
(略)
  • 修改 dolphin 服务 IP 及端口:server/dolphin/standalone-server/conf/application.yaml
(略)
master:
  listen-port: 5678
  
worker:
  # worker listener port
  listen-port: 1234
  
alert:
  port: 50052
  
server:
  port: 12345
(略)

# 8.3 开启 DWS 血缘分析(可选配置)

若要开启则需要先部署 Neo4j4.4.42(介质中不提供,请自行下载),并在 dws_server/config/application-dws.properties 修改配置开启neo4j 请参见 Neo4j安装指南


dws.lineage.enable=false  #设置为true,则启用血缘分析
dws.lineage.secret=b7a75f72567048a78a89c54b23f5240c 
dws.lineage.task.fetch-size=5
dws.lineage.task.fetcher-size=2
dws.lineage.task.fetch-interval=1000
dws.lineage.task.result-cache-size=15
dws.lineage.task.result-flush-interval=10000
dws.lineage.task.result-flush-task-size=50

spring.data.neo4j.uri=bolt://127.0.0.1:7687  #设置为实际的Neoj地址
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=primeton
logging.level.org.springframework.data.neo4j=INFO
management.health.neo4j.enabled=false

image-20250411174917168

# 8.4 dolphin 对接分布式或远端对象存储(可选配置)

如果用户需要使用大数据环境进行文件管理(DWS的数据开发->项目配置->文件管理),则需进行以下配置。

参考 DolphinScheduler的4.对接分布式或远端对象存储

  1. 修改server/dolphin/standalone-server/conf/common.properties文件
  2. 将对应大数据环境的配置文件core-site.xml和hdfs-site.xml拷贝至server/dolphin/standalone-server/conf/目录下。

# 8.5 dolphinscheduler_env.sh环境变量配置说明

startup.sh启动dolphin时,会将${PDI_HOME}和${SEATUNNEL_HOME}替换为介质中primeton-di和seatunnel的相对路径。

image-20250429175801827

若不使用startup.sh脚本启动dolphin,则需要在${DOLPHIN}安装目录/bin/env/dolphinscheduler_env.sh中指定实际的${PDI_HOME}和${SEATUNNEL_HOME}。

image-20250429175908663

← 微服务版(MicroApp)安装指南 微服务版7.0.2升级到7.1.0 →