普元数据开发平台 普元数据开发平台
产品介绍
安装部署
快速入门
操作指南
FAQ
  • DI V8 安装
  • 1. 介质目录结构说明
  • 2. 安装前准备
  • 2.1 请确保机器已配置 JDK 1.8.0_251 及以上
  • 2.2 创建免密用户、配置用户免密及权限
  • 2.3 配置机器SSH免密登陆
  • 2.4 配置/etc/hosts
  • 3. 解压介质
  • 4. 初始化数据库脚本
  • 5. 一键启动/停止服务
  • 6.访问地址
  • 7. 其他参考
  • 7.1 端口号
  • 7.2 配置参考

# DI V8 安装

# 1. 介质目录结构说明

Primeton_Data_Integration_8.0LA2.tar.gz 目录结构说明:

|- Primeton_Data_Integration
    |- server                   # ~ dws server 所在目录
        |- ...
    |- service                  # ~ 引擎服务将被安装到这里
        |- diserver             # ~ DI Server批作业执行引擎
        |- dolphin              # ~ dolphin 调度引擎
        |- seatunnel            # ~ 实时作业执行引擎
        |- zookeeper            # ~ zookeeper
    |- web                      # ~ web前端资源
    |- 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 登陆则证明成功。

# 2.4 配置/etc/hosts

此步骤必须执行,否则会导致zookeeper连接超时异常问题

在/etc/hosts中增加一行,添加服务器ip及域名

vim /etc/hosts
192.168.16.80 server80

# 3. 解压介质

#切换 root 用户 su root

#解压介质 tar -zxvf Primeton_Data_Integration_8.0LA2.tar.gz -C ./

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

# 4. 初始化数据库脚本

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

本说明以 MySQL5.7 数据库为例:

  • 创建 DI 数据库:dws,执行数据库初始化脚本
server/db-scripts/all-Mysql.sql
  • 创建 dolphin 数据库:dolphinscheduler,执行数据库初始化脚本
service/dolphin/standalone-server/conf/sql/dolphinscheduler_mysql.sql

⚠️ 提示:如果与上述示例的数据库名称、用户名、密码不一致,请参考 7.2 配置参考 修改 DI 数据库配置、修改 dolphin 数据库配置。

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

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

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

 #停止服务
 ./shutdown.sh

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

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

# 6.访问地址

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

# 7. 其他参考

# 7.1 端口号

dolphin master dolphin worker dolphin api dolphin alert zookeeper dws
5678 1234 12345 50052 2181 11110

# 7.2 配置参考

  • 修改 DI 数据库配置:server/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:@192.168.16.94: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://192.168.16.86: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://192.168.16.90: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://192.168.16.144: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>
  • 修改 dolphin 数据库配置、JDK 配置:service/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://192.168.16.86:5432/dolphin_dev?stringtype=unspecified"

若使用的数据库是PostgreSQL或openGauss时 ,则需要将介质DWS-patch.zip中的文件解压到server/lib目录下。(其他数据库不需要执行该步骤)

image-20240319173513715

patch_20240726142848.png

  • 修改 DWS 服务 IP 及端口:server/config/application.properties
(略)
server.port=11110
(略)
  • 修改 dolphin 服务 IP 及端口:service/dolphin/standalone-server/conf/application.yaml
(略)
master:
  listen-port: 5678
  
worker:
  # worker listener port
  listen-port: 1234
  
alert:
  port: 50052
  
server:
  port: 12345
(略)

若使用的数据库是PostgreSQL和openGauss ,修改org.quartz.jobStore.driverDelegateClass参数值

quartz:
  properties:
   org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate  
    #默认值为org.quartz.impl.jdbcjobstore.StdJDBCDelegate
  • 修改 zookeeper 服务 IP 及端口:service/zookeeper/conf/zoo.cfg
(略)
# the port at which the clients will connect
clientPort=2181
(略)

← 介质说明 8.0LA升级8.0LA2指南 →