关于CDH6.3.2基础配置如下,和官网要求存在版本差距,并不影响:
MySQL (5.6.24)
JDK (1.8.0_292) ,安装好后在/etc/profile下配置 JAVA_HOME 及 PATH 变量
ZooKeeper (3.4.5)
Hadoop (3.0.0)
比如创建 /opt/dolphinscheduler 做为安装部署目录,下载地址: 下载,下载后上传tar包到该目录中,并进行解压
集群模式:上传到每台节点
配置文件:master机器节点配置即可
1. 创建部署目录,部署目录请不要创建在/root、/home等高权限目录
mkdir -p /opt/module/dolphinscheduler
cd /opt/module/dolphinscheduler
2. 解压缩
tar -zxvf apache-dolphinscheduler-1.3.6-bin.tar.gz -C /opt/module/dolphinscheduler;
mv apache-dolphinscheduler-1.3.6-bin dolphinscheduler
3. 修改目录权限,使得部署用户对dolphinscheduler目录有操作权限
sudo chown -R dolphinscheduler:dolphinscheduler dolphinscheduler
在所有部署调度的机器上创建部署用户,并且一定要配置sudo免密。假如我们计划在hadoop101,hadoop102,hadoop103这3台机器上部署调度,首先需要在每台机器上都创建部署用户
1. 创建用户需使用root登录,设置部署用户名
useradd dolphinscheduler;
2. 设置用户密码
echo "1qaz2wsx" | passwd --stdin dolphinscheduler
3. 配置sudo免密
sudo echo 'dolphinscheduler ALL=(ALL) NOPASSWD: NOPASSWD: ALL' >> /etc/sudoers
sudo sed -i 's/Defaults requirett/#Defaults requirett/g' /etc/sudoers
以第一台机器(hadoop101)作为部署机,配置所有待部署机器的hosts, 在hadoop101以root登录
vi /etc/hosts
#add ip hostname
192.168.xxx.xxx hadoop101
192.168.xxx.xxx hadoop102
192.168.xxx.xxx hadoop103
在hadoop101上,切换到部署用户并配置ssh本机免密登录
su dolphinscheduler
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
ssh-copy-id hadoop102
ssh-copy-id hadoop103
mysql -h192.168.xx.xx -P3306 -uroot -p
1. 创建数据库以及配置相关权限
mysql> CREATE DATABASE dolphinscheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
mysql> GRANT ALL PRIVILEGES ON dolphinscheduler.* TO 'dolphinscheduler'@'%' IDENTIFIED BY '1qaz2wsx';
mysql> GRANT ALL PRIVILEGES ON dolphinscheduler.* TO 'dolphinscheduler'@'localhost' IDENTIFIED BY '1qaz2wsx';
mysql> flush privileges;
1. 创建表和导入基础数据
修改 conf 目录下 datasource.properties 中的下列配置
vi conf/datasource.properties
2. 添加jar包
还需要手动添加 [ mysql-connector-java 驱动 jar ] 包到 lib 目录下
mysql-connector-java-8.0.19.jar
3. 配置数据库连接信息
# mysql
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://hadoop101:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
spring.datasource.username=dolphinscheduler
spring.datasource.password=1qaz2wsx
4. 执行创建表及导入基础数据脚本
sh script/create-dolphinscheduler.sh
1. 修改 conf/env 目录下的 dolphinscheduler_env.sh 环境变量
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/CDH/lib/spark
export PYTHON_HOME=/opt/module/anaconda3/bin/python
export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera
export HIVE_HOME=/opt/cloudera/parcels/CDH/lib/hive
#export FLINK_HOME=/opt/soft/flink
#export DATAX_HOME=/opt/soft/datax/bin/datax.pyexport PATH= H A D O O P H O M E / b i n : HADOOP_HOME/bin: HADOOPHOME/bin:SPARK_HOME1/bin: S P A R K H O M E 2 / b i n : SPARK_HOME2/bin: SPARKHOME2/bin:PYTHON_HOME: J A V A H O M E / b i n : JAVA_HOME/bin: JAVAHOME/bin:HIVE_HOME
2. 将jdk软链到/usr/bin/java下
sudo ln -s /usr/java/jdk1.8.0_181-cloudera/bin/java /usr/bin/java
3. 修改一键部署配置文件 conf/config/install_config.conf中的各参数
dbtype="mysql"
#db config
#db address and port
dbhost="192.168.202.101:3306"
#db username
username="dolphinscheduler"
#database name
dbname="dolphinscheduler"
#db passwprd
password="1qaz2wsx"
#zk cluster
zkQuorum="192.168.202.101:2181,192.168.202.102:2181,192.168.202.103:2181"
#将DS安装到哪个目录,如: /opt/soft/dolphinscheduler,不同于现在的目录
installPath="/opt/dolphinscheduler"
# deployment user
deployUser="dolphinscheduler"
# alert config
# mail server host
mailServerHost="smtp.exmail.qq.com"
# mail server port
correct. mailServerPort="25"
# sender
mailSender="[email protected]"
# mailSender和mailUser配置成一样即可
# user
mailUser="[email protected]"
# sender password
mailPassword="xxxxxxxxxxx"
# TLS协议的邮箱设置为true,否则设置为false
starttlsEnable="true"
# SSL mail protocol support
# 开启SSL协议的邮箱配置为true,否则为false。注意: starttlsEnable和sslEnable不能同时为true
sslEnable="false"
#note: sslTrust is the same as mailServerHost
sslTrust="smtp.exmail.qq.com"
# 业务用到的比如sql等资源文件上传到哪里,可以设置:HDFS,S3,NONE,单机如果想使用本地文件系统,请配置为HDFS,因为HDFS支持本地文件系统;如果不需要资源上传功能请选择NONE。强调一点:使用本地文件系统不需要部署hadoop
resourceStorageType="HDFS"
#如果上传资源保存想保存在hadoop上,hadoop集群的NameNode启用了HA的话,需要将hadoop的配置文件core-site.xml和hdfs-site.xml放到安装路径的conf目录下,本例即是放到/opt/soft/dolphinscheduler/conf下面,并配置namenode cluster名称;如果NameNode不是HA,则只需要将mycluster修改为具体的ip或者主机名即可
defaultFS="hdfs://192.168.202.101: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,保持以下默认值即可;如果ResourceManager是HA,则配置为ResourceManager节点的主备ip或者hostname,比如"192.168.xx.xx,192.168.xx.xx";如果是单ResourceManager请配置yarnHaIps=""即可
yarnHaIps="192.168.202.102"
# 如果ResourceManager是HA或者没有使用到Yarn保持默认值即可;如果是单ResourceManager,请配置真实的ResourceManager主机名或者ip
#singleYarnIp="yarnIp1"
singleYarnIp="192.168.202.102"
# 资源上传根路径,主持HDFS和S3,由于hdfs支持本地文件系统,需要确保本地文件夹存在且有读写权限
resourceUploadPath="/data/dolphinscheduler"
#具备权限创建resourceUploadPath的用户
hdfsRootUser= hdfsRootUser="hdfs"
# api server port
apiServerPort="12345"
# install hosts
#在哪些机器上部署DS服务,本机选localhost
ips="hadoop101,hadoop102,hadoop103"
# ssh port, default 22
# Note: if ssh port is not default, modify here
sshPort="22"
# run master machine
# masters="ds1,ds2"
masters="hadoop101"
# run worker machine
# worker服务部署在哪台机器上,并指定此worker属于哪一个worker组,下面示例的default即为组名
workers="hadoop102:default,hadoop103:default"
# run alert machine
# 报警服务部署在哪台机器上
alertServer="hadoop101"
# run api machine
# 后端api服务部署在在哪台机器上
apiServers="hadoop101"
注意:
如果需要用资源上传到Hadoop集群功能, 并且Hadoop集群的NameNode 配置了 HA的话 ,需要开启 HDFS类型的资源上传,同时需要将Hadoop集群下的core-site.xml和hdfs-site.xml复制到/opt/dolphinscheduler/conf,非NameNode HA跳过次步骤
1、切换到部署用户dolphinscheduler,然后执行一键部署脚本
sh install.sh
2、脚本完成后,会启动以下5个服务
jps
MasterServer ----- master服务
WorkerServer ----- worker服务
LoggerServer ----- logger服务
ApiApplicationServer ----- api服务
AlertServer ----- alert服务
如果以上服务都正常启动,说明自动部署成功
部署成功后,可以进行日志查看,日志统一存放于logs文件夹内
dolphinscheduler的log日志目录:
cd /opt/dolphinscheduler/logs
http://hadoop101:12345/dolphinscheduler
用户名: admin
密 码: dolphinscheduler123
1、一键停止集群所有服务
sh ./bin/stop-all.sh
2、一键开启集群所有服务
sh ./bin/start-all.sh
3、启停Master
sh ./bin/dolphinscheduler-daemon.sh start master-server
sh ./bin/dolphinscheduler-daemon.sh stop master-server
4、启停Worker
sh ./bin/dolphinscheduler-daemon.sh start worker-server
sh ./bin/dolphinscheduler-daemon.sh stop worker-server
5、启停Api
sh ./bin/dolphinscheduler-daemon.sh start api-server
sh ./bin/dolphinscheduler-daemon.sh stop api-server
6、启停Logger
sh ./bin/dolphinscheduler-daemon.sh start logger-server
sh ./bin/dolphinscheduler-daemon.sh stop logger-server
7、启停Alert
sh ./bin/dolphinscheduler-daemon.sh start alert-server
sh ./bin/dolphinscheduler-daemon.sh stop alert-server