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