找回密码
 立即注册
查看: 642|回复: 0

CentOS7 安装 DolphinScheduler 伪集群 保姆级教程

[复制链接]

194

主题

0

回帖

986

积分

管理员

积分
986
发表于 2024-6-9 16:41:58 | 显示全部楼层 |阅读模式
安装环境:
CentOS-7-x86_64-DVD-2207-02.iso + apache-dolphinscheduler-3.1.9-bin.tar.gz +  apache-zookeeper-3.8.4-bin.tar.gz + postgresql-16.3.tar.gz + jdk-8u411-linux-x64.tar.gz + postgresql-42.7.3.jar

PG 驱动   postgresql-42.7.3.jar 传送门
本教程使用离线安装,教程中安装包放在D:\Soft文件夹中。

#1 CentOS7 安装 PostgreSQL 保姆级教程
传送门
#2 CentOS7 安装 zookeeper 保姆级教程
传送门
#3 1、2安装完后,PostgreSQL + zookeeper + jdk 都已经完成。
#4 PostgreSQL  创建 dolphinscheduler 库
  1. cd /home/soft/postgresql/bin
  2. ./psql -h localhost -p 5432 -U postgres
  3. CREATE DATABASE dolphinscheduler;
复制代码
#5 创建软件安装路径
  1. mkdir -p /opt/soft
  2. mkdir -p /home/soft/dolphinscheduler
复制代码
#6 将下载的离线安装包、驱动 从Windows上传到Centos7   (cmd中运行下面内容)
  1. scp D:\Soft\apache-dolphinscheduler-3.1.9-bin.tar.gz [email protected]:/opt/soft
  2. scp D:\Soft\postgresql-42.7.3.jar [email protected]:/opt/soft
复制代码
#7 解压上传的安装包
  1. cd /opt/soft
  2. tar -zxvf apache-dolphinscheduler-3.1.9-bin.tar.gz
复制代码
#8 配置root用户免密登录
  1. ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
  2. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  3. chmod 600 ~/.ssh/authorized_keys  
复制代码
#9 创建dolphinscheduler用户,配置sudo权限,并切换到dolphinscheduler用户
  1. useradd dolphinscheduler
  2. echo "dolphinscheduler" | passwd --stdin dolphinscheduler
  3. sed -i '$adolphinscheduler  ALL=(ALL)  NOPASSWD: NOPASSWD: ALL' /etc/sudoers
  4. sed -i 's/Defaults    requirett/#Defaults    requirett/g' /etc/sudoers
  5. su dolphinscheduler
复制代码
#10 配置dolphinscheduler用户免密登录
  1. ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
  2. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  3. chmod 600 ~/.ssh/authorized_keys
  4. exit
复制代码
#11 配置 dolphinscheduler 安装信息
  1. vi /opt/soft/apache-dolphinscheduler-3.1.9-bin/bin/env/install_env.sh
复制代码
  1. # 需要安装DolphinScheduler相关组件的主机
  2. ips=${ips:-"localhost"}
  3. # SSH协议端口号,默认为22。
  4. sshPort=${sshPort:-"22"}
  5. # 需要安装master节点的主机
  6. masters=${masters:-"localhost"}
  7. # 需要安装worker节点的主机
  8. workers=${workers:-"localhost:default"}
  9. # 需要安装警报服务的主机
  10. alertServer=${alertServer:-"localhost"}
  11. # 需要安装api服务的主机
  12. apiServers=${apiServers:-"localhost"}
  13. # 安装dolphinscheduler的目录。如果不存在,将由install.sh脚本创建。
  14. installPath=${installPath:-"/home/soft/dolphinscheduler"}
  15. # 部署dolphinscheduler的用户
  16. deployUser=${deployUser:-"dolphinscheduler"}
  17. # zookeeper的根目录,目前DolphinScheduler默认的注册服务器是zookeeper。
  18. zkRoot=${zkRoot:-"/home/soft/zookeeper"}
复制代码
#12 配置jdk、数据库、zookeeper信息
  1. vi /opt/soft/apache-dolphinscheduler-3.1.9-bin/bin/env/dolphinscheduler_env.sh
复制代码
  1. # 修改为自己的jdk安装目录
  2. export JAVA_HOME=${JAVA_HOME:-${JAVA_HOME}}
  3. # 修改MySQL配置
  4. export DATABASE=${DATABASE:-postgresql}
  5. export SPRING_PROFILES_ACTIVE=${DATABASE}
  6. export SPRING_DATASOURCE_URL=jdbc:postgresql://127.0.0.1:5432/dolphinscheduler
  7. export SPRING_DATASOURCE_USERNAME=postgres
  8. export SPRING_DATASOURCE_PASSWORD=postgres123
  9. # 注册中心配置,修改为自己的zookeeper监听地址
  10. export REGISTRY_TYPE=${REGISTRY_TYPE:-zookeeper}
  11. export REGISTRY_ZOOKEEPER_CONNECT_STRING=${REGISTRY_ZOOKEEPER_CONNECT_STRING:-localhost:12181}
复制代码
#13 修改正确的数据库账号密码,不修改启动显示runing,实际未启动(数据库配置在最后,根据自己数据库实际信息配置)
  1. vi /opt/soft/apache-dolphinscheduler-3.1.9-bin/standalone-server/conf/application.yaml
复制代码
#14  本教程使用PostgreSQL,将PostgreSQLjdbc驱动拷贝到对应目录。若用MySQL请下载Mysql驱动(commons-cli + mysql-connector)。
  1. cp /opt/soft/postgresql-42.7.3.jar /opt/soft/apache-dolphinscheduler-3.1.9-bin/worker-server/libs
  2. cp /opt/soft/postgresql-42.7.3.jar /opt/soft/apache-dolphinscheduler-3.1.9-bin/api-server/libs
  3. cp /opt/soft/postgresql-42.7.3.jar /opt/soft/apache-dolphinscheduler-3.1.9-bin/alert-server/libs
  4. cp /opt/soft/postgresql-42.7.3.jar /opt/soft/apache-dolphinscheduler-3.1.9-bin/master-server/libs
  5. cp /opt/soft/postgresql-42.7.3.jar /opt/soft/apache-dolphinscheduler-3.1.9-bin/tools/libs
  6. cp /opt/soft/postgresql-42.7.3.jar /opt/soft/apache-dolphinscheduler-3.1.9-bin/standalone-server/libs/standalone-server
复制代码
#15 初始化数据库
  1. chmod 777 /opt/soft/apache-dolphinscheduler-3.1.9-bin/tools/bin/upgrade-schema.sh
  2. /opt/soft/apache-dolphinscheduler-3.1.9-bin/tools/bin/upgrade-schema.sh
复制代码
#16 修改apache-dolphinscheduler-3.1.4-bin目录权限到dolphinscheduler用户。
  1. cd /opt/soft
  2. chown -R dolphinscheduler:dolphinscheduler apache-dolphinscheduler-3.1.9-bin
  3. cd /home/soft
  4. chown -R dolphinscheduler:dolphinscheduler dolphinscheduler
复制代码
#17 安装部署dolphinscheduler
  1. cd /opt/soft/apache-dolphinscheduler-3.1.9-bin
  2. bash ./bin/install.sh
复制代码
############以上执行完就代表完成了##############

浏览器访问地址 http://localhost:12345/dolphinscheduler/ui 即可登录系统UI。默认的用户名和密码是 admin/dolphinscheduler123

dolphinscheduler命令
# 查看服务启动状态

cd /home/soft/dolphinscheduler
bash ./bin/status-all.sh
# 一键停止集群所有服务
cd /home/soft/dolphinscheduler
bash ./bin/stop-all.sh
# 一键开启集群所有服务
cd /home/soft/dolphinscheduler
bash ./bin/start-all.sh
# 启停 Master
cd /home/soft/dolphinscheduler
bash ./bin/dolphinscheduler-daemon.sh stop master-server
bash ./bin/dolphinscheduler-daemon.sh start master-server
# 启停 Worker
cd /home/soft/dolphinscheduler
bash ./bin/dolphinscheduler-daemon.sh start worker-server
bash ./bin/dolphinscheduler-daemon.sh stop worker-server
# 启停 Api
cd /home/soft/dolphinscheduler
bash ./bin/dolphinscheduler-daemon.sh start api-server
bash ./bin/dolphinscheduler-daemon.sh stop api-server
# 启停 Alert
cd /home/soft/dolphinscheduler
bash ./bin/dolphinscheduler-daemon.sh start alert-server
bash ./bin/dolphinscheduler-daemon.sh stop alert-server

如果UI可以进,可以不必检查以下内容
sudo yum install curl
### 检查 服务是否起来 因为显示runing有可能不是真起来。一般检查此项代表UI以下三项可以不用查了
[dolphinscheduler@localhost dolphinscheduler]$ curl --request GET 'http://localhost:12345/dolphinscheduler/actuator/health'
{"status":"UP","components":{"db":{"status":"UP","details":{"database":"PostgreSQL","validationQuery":"select 1","result":1}}}}
###UI不能登录不用查此项
[dolphinscheduler@localhost dolphinscheduler]$ curl --request GET 'http://localhost:5679/actuator/health'
{"status":"UP","components":{"db":{"status":"UP","details":{"database":"PostgreSQL","validationQuery":"select 1","result":1}}}}
###UI不能登录不用查此项
[dolphinscheduler@localhost dolphinscheduler]$ curl --request GET 'http://localhost:1235/actuator/health'
{"status":"UP","components":{"db":{"status":"UP","details":{"database":"PostgreSQL","validationQuery":"select 1","result":1}}}}
###UI不能登录不用查此项
[dolphinscheduler@localhost dolphinscheduler]$ curl --request GET 'http://localhost:50053/actuator/health'
{"status":"UP","components":{"db":{"status":"UP","details":{"database":"PostgreSQL","validationQuery":"select 1","result":1}}}}

启动显示RUNING 实际未启动时可检查机器内存是否充足(内存预留8G左右才能启动)。



商务合作
业务洽谈
Wechat:S3-SH-CN  
QQ群:128669090
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|S3软件

GMT+8, 2026-6-6 09:48 , Processed in 0.049276 second(s), 19 queries .

Powered by S3

©2001-2025 S3 Team.

快速回复 返回顶部 返回列表