点击蓝色字关注!

本篇文章大概8440字,阅读时间大约20分钟

本文记录了在CDH5.16.2集群上集成Dolphin Scheduler 1.3.1的详细流程,特别注意一下MySQL数据库的连接串!

1

文档编写目的

  • 详细记录CDH5上Dolphin Scheduler 1.3.1的部署流程

  • 分布式部署Dolphin Scheduler

2

部署环境和依赖组件

为了适配CDH5上的Hive版本, 需要对DS进行源码编译部署,最后会提供编译好的CDH5版本供各位老铁下载

集群环境

  • CDH 5.16.2

    • HDFS和YARN都是单点

  • DS的官网

    • https://dolphinscheduler.apache.org/en-us/

DS依赖组件

  • MySQL:用于存储dolphin scheduler的元数据,也可以使用pg,这里主要是因为CDH集群使用的是MySQL

  • Zookeeper:使用CDH集群的zk

3

Dolphin Scheduler 1.3.1集群规划

DS服务
master.eights.com
dn1.eights.com
dn2.eights.com
api

√
master
√ √
worker/log
√
√
alert

√

4

源码编译

前置条件

  • maven

  • jdk

  • nvm

代码拉取

git clone https://github.com/apache/incubator-dolphinscheduler.git

切换CDH5分支

git checkout 1.3.1-release;
git checkout -b ds-1.3.1-cdh5.16.2;

修改pom

修改根root的hadoop版本,hive版本和version信息,将每一个模块的version都调整为1.3.1-cdh5.16.2

<hadoop.version>2.6.0</hadoop.version>
<hive.jdbc.version>1.1.0</hive.jdbc.version>
<version>1.3.1-cdh5.16.2</version>

去除mysql包的scope

执行编译命令进行源码编译

mvn -U clean package -Prelease -Dmaven.test.skip=true

编译完成后,dolphinscheduler-dist目录会生成

apache-dolphinscheduler-incubating-1.3.1-cdh5.16.2-dolphinscheduler-bin.tar.gz包,1.3.1版本的前后端是打在一起的,并没有两个包.

5

组件部署

准备工作

  • 创建部署用户及配置SSH免密

在所有部署机器上创建部署用户,ds在进行任务执行的时候会以sudo -u [linux-user]的方式来执行作业,这里采用dscheduler作为部署用户。

# 添加部署用户
useradd dscheduler;
# 设置密码
echo "dscheduler" | passwd --stdin dscheduler
# 配置免密
echo 'dscheduler ALL=(ALL) NOPASSWD: NOPASSWD: ALL' >> /etc/sudoers # 切换到部署用户并生成ssh key
su dscheduler;
ssh-keygen -t rsa;
ssh-copy-id -i ~/.ssh/id_rsa.pub dscheduler@[hostname];

创建ds的元数据库-MySQL

CREATE DATABASE dolphinscheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE
utf8_general_ci;
CREATE USER 'dscheduler'@'%' IDENTIFIED BY 'dscheduler';
GRANT ALL PRIVILEGES ON dolphinscheduler.* TO 'dscheduler'@'%' IDENTIFIED BY 'dscheduler';
flush privileges;

安装包解压&权限修改

上传安装包到集群/opt目录,执行解压

# 解压安装包
tar -zxvf apache-dolphinscheduler-incubating-1.3.1-cdh5.16.2-dolphinscheduler-bin.tar.gz -C /opt/ # 重命名
mv apache-dolphinscheduler-incubating-1.3.1-cdh5.16.2-dolphinscheduler-bin ds-1.3.1-cdh5.16.2 # 修改文件权限和组
chmod -R 755 ds-1.3.1-cdh5.16.2;
chown -R dscheduler:dscheduler ds-1.3.1-cdh5.16.2;

初始化MySQL

修改数据库配置

这里特别注意数据库的连接配置

这里特别注意数据库的连接配置

这里特别注意数据库的连接配置

vi /opt/ds-1.3.1-cdh5.16.2/conf/datasource.properties;

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://cm.eights.com:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
spring.datasource.username=dscheduler
spring.datasource.password=dscheduler

在ds的安装包目录下执行数据库初始化脚本

./script/create-dolphinscheduler.sh

配置ds所需的环境变量,这里记住一定要配,ds在执行任务的时候会先source dolphinscheduler_env.sh

vi /opt/ds-1.3.1-cdh5.16.2/conf/env/dolphinscheduler_env.sh

# 测试集群上没有datax和flink请忽略相关配置
export HADOOP_HOME=/opt/cloudera/parcels/CDH/lib/hadoop
export HADOOP_CONF_DIR=/opt/cloudera/parcels/CDH/lib/hadoop/etc/hadoop
export SPARK_HOME1=/opt/cloudera/parcels/CDH/lib/spark
export SPARK_HOME2=/opt/cloudera/parcels/SPARK2/lib/spark2
export PYTHON_HOME=/usr/local/anaconda3/bin/python
export JAVA_HOME=/usr/java/jdk1.8.0_131
export HIVE_HOME=/opt/cloudera/parcels/CDH/lib/hive
export FLINK_HOME=/opt/soft/flink
export DATAX_HOME=/opt/soft/datax/bin/datax.py

编写ds的配置文件

ds在1.3.0之前,一键部署的配置文件在install.sh中。1.3.0版本的install.sh脚本只是一个部署脚本,部署配置文件在conf/config/install_config.conf中。install_config.conf精简了很多非必须的参数,如果要进一步的进行参数调整,则需要去修改conf下对应模块的配置文件。

下面给出本次部署的集群部署配置

# NOTICE : If the following config has special characters in the variable `.*[]^${}\+?|()@#&`, Please escape, for example, `[` escape to `\[`
# postgresql or mysql
dbtype="mysql" # db config
# db address and port
dbhost="cm.eights.com:3306" # db username
username="dscheduler" # database name
dbname="dolphinscheduler" # db passwprd
# NOTICE: if there are special characters, please use the \ to escape, for example, `[` escape to `\[`
password="dscheduler" # zk cluster
zkQuorum="master.eights.com:2181,dn1.eights.com:2181,cm.eights.com:2181" # Note: the target installation path for dolphinscheduler, please not config as the same as the current path (pwd)
# 在每台部署机器上 安装ds的目录,角色的日志文件和任务日志都在这个目录下
installPath="/opt/ds-1.3.1-agent" # deployment user
# Note: the deployment user needs to have sudo privileges and permissions to operate hdfs. If hdfs is enabled, the root directory needs to be created by itself
deployUser="dscheduler" # 邮件我这边是内网邮箱,后续会出外网邮件的配置方法
# alert config
# mail server host
mailServerHost="xxxx" # mail server port
# note: Different protocols and encryption methods correspond to different ports, when SSL/TLS is enabled, make sure the port is correct.
mailServerPort="25" # sender
mailSender="xxxx" # user
mailUser="xxxx" # sender password
# note: The mail.passwd is email service authorization code, not the email login password.
mailPassword="xxxx" # TLS mail protocol support
starttlsEnable="false" # SSL mail protocol support
# only one of TLS and SSL can be in the true state.
sslEnable="false" #note: sslTrust is the same as mailServerHost
sslTrust="xxxxxx" # resource storage type:HDFS,S3,NONE
resourceStorageType="HDFS" # 单点的HDFS和yarn直接进行配置即可
# if resourceStorageType is HDFS,defaultFS write namenode address,HA you need to put core-site.xml and hdfs-site.xml in the conf directory.
# if S3,write S3 address,HA,for example :s3a://dolphinscheduler,
# Note,s3 be sure to create the root directory /dolphinscheduler
defaultFS="hdfs://master.eights.com:8020" # if resourceStorageType is S3, the following three configuration is required, otherwise please ignore
s3Endpoint="http://192.168.xx.xx:9010"
s3AccessKey="xxxxxxxxxx"
s3SecretKey="xxxxxxxxxx" # 这里注意,即使yarn是单点也最好把yarnHaIps配上
# if resourcemanager HA enable, please type the HA ips ; if resourcemanager is single, make this value empty
yarnHaIps="master.eights.com" # if resourcemanager HA enable or not use resourcemanager, please skip this value setting; If resourcemanager is single, you only need to replace yarnIp1 to actual resourcemanager hostname.
singleYarnIp="master.eights.com" # resource store on HDFS/S3 path, resource file will store to this hadoop hdfs path, self configuration, please make sure the directory exists on hdfs and have read write permissions。/dolphinscheduler is recommended
resourceUploadPath="/dolphinscheduler" # who have permissions to create directory under HDFS/S3 root path
# Note: if kerberos is enabled, please config hdfsRootUser=
hdfsRootUser="hdfs" # kerberos config
# whether kerberos starts, if kerberos starts, following four items need to config, otherwise please ignore
kerberosStartUp="false"
# kdc krb5 config file path
krb5ConfPath="$installPath/conf/krb5.conf"
# keytab username
keytabUserName="hdfs-mycluster@ESZ.COM"
# username keytab path
keytabPath="$installPath/conf/hdfs.headless.keytab" # api server port
apiServerPort="12345" # install hosts
# Note: install the scheduled hostname list. If it is pseudo-distributed, just write a pseudo-distributed hostname
ips="master.eights.com,dn1.eights.com,dn2.eights.com" # ssh port, default 22
# Note: if ssh port is not default, modify here
sshPort="22" # run master machine
# Note: list of hosts hostname for deploying master
masters="master.eights.com,dn1.eights.com" # run worker machine
# 1.3.1把worker分组从mysql移到了zookeeper中,这个需要打worker的标签
# 目前还不支持一个worker属于多个分组
# note: need to write the worker group name of each worker, the default value is "default"
workers="master.eights.com:default,dn2.eights.com:sqoop" # run alert machine
# note: list of machine hostnames for deploying alert server
alertServer="dn1.eights.com" # run api machine
# note: list of machine hostnames for deploying api server
apiServers="dn1.eights.com"

添加Hadoop集群配置文件

  • 如果集群未启用HA,直接在install_config.conf文件中进行编写

  • 如果集群启用了HA,请将hadoop的hdfs-site.xml和core-site.xml拷贝到/conf目录下

修改JVM参数

  • 两个文件

    • /bin/dolphinscheduler-daemon.sh

    • /scripts/dolphinscheduler-daemon.sh

export DOLPHINSCHEDULER_OPTS="-server -Xmx16g -Xms1g -Xss512k
-XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled
-XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods
-XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70"

一键部署&进程检查&单服务启停

# 运行部署ds脚本
sh install.sh # 进程检查
jps

服务启停

# 一键停止
sh ./bin/stop-all.sh
# 一键开启
sh ./bin/start-all.sh
# 启停master
sh ./bin/dolphinscheduler-daemon.sh start master-server
sh ./bin/dolphinscheduler-daemon.sh stop master-server
# 启停worker
sh ./bin/dolphinscheduler-daemon.sh start worker-server
sh ./bin/dolphinscheduler-daemon.sh stop worker-server
# 启停api-server
sh ./bin/dolphinscheduler-daemon.sh start api-server
sh ./bin/dolphinscheduler-daemon.sh stop api-server
# 启停logger
sh ./bin/dolphinscheduler-daemon.sh start logger-server
sh ./bin/dolphinscheduler-daemon.sh stop logger-server
# 启停alert
sh ./bin/dolphinscheduler-daemon.sh start alert-server
sh ./bin/dolphinscheduler-daemon.sh stop alert-server

前端访问

dolphinscheduler-1.3.1前端不在需要nginx,直接使用

apiserver:12345/dolphinscheduler进行访问

账号 admin 密码 dolphinscheduler123登陆

检查worker分组

  • 可以看到1.3.1版本的worker分组是通过install_config.conf去执行的,在页面上不能进行修改

检查服务

编译好的Dolphin Scheduler-1.3.1-cdh5.16.2的包

百度网盘

链接:

https://pan.baidu.com/s/1gEwEF2R2XJVRv76SgiW0hA

提取码:joyq

6

总结

dolphinscheduler-1.3.1版本在部署上大幅精简了install.sh的配置,可以让用户快速部署起来。不过如果做升级的老铁就需要去conf目录下修改对应模块的配置文件。

前端这块也不再需要单独的nginx,用户的部署体验更佳

扫描二维码

获取历史文章

Eights

点个在看吧~

如何在CDH5上部署Dolphin Scheduler 1.3.1的更多相关文章

  1. 如何在github上部署自己的前端项目

    很多时候我们想需要一个地址就可以访问自己的前端作品, 但是注册一个服务器和域名是需要花钱,很多小伙伴都不愿意, 其实这种前端静态页面github就可以帮我们预览其效果,而且只要在有网的情况下都可以访问 ...

  2. 入门实践丨如何在K3s上部署Web应用程序

    在本文中,我们将使用Flask和JavaScript编写的.带有MongoDB数据库的TODO应用程序,并学习如何将其部署到Kubernetes上.这篇文章是针对初学者的,如果你之前没有深度接触过Ku ...

  3. 如何在windows上部署war包到tomcat服务器

    一. 什么是war包 WAR(Web Archive file)网络应用程序文件,是与平台无关的文件格式,它允许将很多文件组合成一个压缩文件.war专用在web方面,一个war包可以理解为一个web项 ...

  4. 如何在Windows上部署Redis集群和SpringBoot进行整合

    一.安装Redis的Windows版本并进行配置 (1)下载链接 https://github.com/microsoftarchive/redis/releases (2)将下载后的Redis复制成 ...

  5. 如何在linux上部署vue项目

    安装nginx的前奏 安装依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 创建一个文件夹 cd /usr/ ...

  6. 关于如何在Linux上使用Nugix反向代理部署net core3.1项目

    本文意在教大家如何在Linux上部署net core web项目,本人通过实践已经成功可以通过外网访问我部署在阿里云服务器上的站点. 一:需要用到的东西如下: 1:一个基于net core框架下的we ...

  7. Dolphin Scheduler 1.1.0升级1.2.0避坑指南

    本文章经授权转载 组件介绍 Apache Dolphin Scheduler是一个分布式易扩展的可视化DAG工作流任务调度系统.致力于解决数据处理流程中错综复杂的依赖关系,使调度系统在数据处理流程中开 ...

  8. 使用wfastcgi在IIS上部署Python Flask应用

    本文介绍了如何在Windows上部署Python Flask应用,相关环境如下: 操作系统:windows 7 Python:3.4 WFastCGI: 2.2 应用所用到的包版本如下: Flask= ...

  9. .NET开发框架(五)-IIS上部署ASP.NET Core项目教程

    系列教程:从初学者到架构师的一步步蜕变 本篇经验将和大家介绍如何在IIS上部署ASP.NET Core项目,希望对初学.NET CORE的童靴入门有所帮助! 1.打开VS,创建项目,选择ASP.NET ...

随机推荐

  1. 每天一个 HTTP 状态码 前言

    前前言 在重新开始写博文(其实大多也就最多算是日常笔记小结)之际,就想着从短小精悍的文章入手,就想到了 HTTP 状态码.另外,记得很久之前,看过一个<每天一个 Linux 命令>系列文章 ...

  2. 【系统问题】windows10打印就蓝屏-报错误代码“win32kfull.sys”

    现象描述: 打印机一打印电脑就蓝屏,蓝屏错误代码为:win32kfull.sys 原因分析: 2021年3月9日-推送了KB5000802补丁更新(操作系统内部版本19041.867和19042.86 ...

  3. Redis 中的原子操作(1)-Redis 中命令的原子性

    Redis 如何应对并发访问 Redis 中处理并发的方案 原子性 Redis 的编程模型 Unix 中的 I/O 模型 thread-based architecture(基于线程的架构) even ...

  4. Eoapi — 一个可拓展的开源 API 工具

    ​ 在社区中时常会出现"抱怨某商业产品越来越臃肿"的声音,API 工具也是如此.从最早期只做 API 调试的工具,到经过多年的演进后集成全面功能的"庞然大物", ...

  5. CabloyJS的微信API对接模块:当前支持微信公众号和微信小程序

    Cabloy-微信是什么 Cabloy-微信是基于CabloyJS全栈业务开发框架开发的微信接口模块,当前整合了微信公众号和微信小程序的接口,达到开箱即用的使用效果.在Cabloy-微信的基础上,可以 ...

  6. neo4j删除节点和关系

    两种方法: 一.用下列 Cypher 语句: match (n) detach delete n 原理:匹配所有的节点,然后进行删除. 二. 从文件系统上删除对应的数据库. 1.停掉服务: 2.删除 ...

  7. 浅析Kubernetes架构之workqueue

    通用队列 在kubernetes中,使用go的channel无法满足kubernetes的应用场景,如延迟.限速等:在kubernetes中存在三种队列通用队列 common queue ,延迟队列 ...

  8. mysql5.7安装要踩的坑

    因为官网下载的是绿色版,所以要做一些配置 1.在mysql根目录新增data文件夹和my.ini文件 my.ini文件内容 [mysql]# 设置mysql客户端默认字符集default-charac ...

  9. bat-使用bat安装jdk和配置环境变量

    文件路径 @echo off Setlocal enabledelayedexpansion @REM vscode中自动开启延迟环境变量扩展, %~d0 cd %~dp0 @REM dir echo ...

  10. Bitbucket 使用 SSH 拉取仓库失败的问题

    问题 在 Bitbucket 使用 Linux 机器上 ssh-keygen 工具生成的公钥作为 API KEY,然后在 Jenkins 里面存储对应的 SSH 私钥,最后执行 Job 的时候,Win ...