赞
踩
三台服务器都要安装
解压安装包
sudo tar -zxvf apache-dolphinscheduler-3.1.1-SNAPSHOT-bin.tar.gz -C /opt/module/
将安装目录的所属用户给配好的免密用户
sudo chown dolphinscheduler:dolphinscheduler -R apache-dolphinscheduler-3.1.1-SNAPSHOT-bin
切换用户
su - dolphinscheduler
groupadd dolphinscheduler
useradd -g dolphinscheduler dolphinscheduler
vim /etc/sudoers
配置如下内容,保存退出
dolphinscheduler ALL=(ALL) ALL
dolphinscheduler ALL=(ALL) NOPASSWD:NOPASSWD:ALL
生成当前用户的秘钥文件:ssh-keygen -t rsa
然后将生成的公钥文件内容写到目标机.ssh/authorized_keys文件中,OK
海豚所在每台节点之间都要互相免密
普通用户建立免密要注意权限 700,否则也不会成功
/opt/module/dolphinscheduler-3.1.0_standalone/bin/env
[dolphinscheduler@gateway02 bin]$ vim install.sh
ips="192.168.8.1,192.168.8.2,192.168.8.3,192.168.8.4,192.168.8.5"
ips=${ips:-"cdh212,cdh213,cdh214"}
sshPort=${sshPort:-"22"}
masters=${masters:-"cdh214,cdh213"}
workers=${workers:-"cdh212:default,cdh213:default,cdh214:default"}
alertServer=${alertServer:-"cdh213"}
apiServers=${apiServers:-"cdh214"}
installPath=${installPath:-"/opt/module/dolphinscheduler-3.1.0_cluster"}
deployUser=${deployUser:-"dolphinscheduler"}
zkRoot=${zkRoot:-"/dolphinscheduler_3_1_0"}
[dolphinscheduler@gateway02 env]$ vim dolphinscheduler_env.sh # JAVA_HOME, will use it to start DolphinScheduler server export JAVA_HOME= /dsg/public/jdk1.8.0_281/ # Database related configuration, set database type, username and password export DATABASE=mysql export SPRING_PROFILES_ACTIVE=${DATABASE} export SPRING_DATASOURCE_URL="jdbc:mysql://10.84.34.214:3306/dolphinscheduler_3_1_1?useUnicode=true&characterEncoding=UTF-8" export SPRING_DATASOURCE_USERNAME=dolphinscheduler export SPRING_DATASOURCE_PASSWORD=Dsg_1234 # DolphinScheduler server related configuration export SPRING_CACHE_TYPE=${SPRING_CACHE_TYPE:-none} export SPRING_JACKSON_TIME_ZONE=${SPRING_JACKSON_TIME_ZONE:-Asia/Shanghai} export MASTER_FETCH_COMMAND_NUM=${MASTER_FETCH_COMMAND_NUM:-10} # Registry center configuration, determines the type and link of the registry center export REGISTRY_TYPE=${REGISTRY_TYPE:-zookeeper} export REGISTRY_ZOOKEEPER_CONNECT_STRING=${REGISTRY_ZOOKEEPER_CONNECT_STRING:-cdh207:2181,cdh208:2181,cdh209:2181} # Tasks related configurations, need to change the configuration if you use the related tasks. export HADOOP_HOME=${HADOOP_HOME:-/opt/cloudera/parcels/CDH/lib/hadoop} export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-/etc/hadoop} export SPARK_HOME1=${SPARK_HOME1:-/opt/cloudera/parcels/CDH/lib/spark} # export SPARK_HOME2=${SPARK_HOME2:-/opt/soft/spark2} # export PYTHON_HOME=${PYTHON_HOME:-/opt/soft/python} export HIVE_HOME=${HIVE_HOME:-/opt/cloudera/parcels/CDH/lib/hive} export FLINK_HOME=${FLINK_HOME:-/opt/cloudera/parcels/FLINK/lib/flink} # export DATAX_HOME=${DATAX_HOME:-/opt/soft/datax} # export SEATUNNEL_HOME=${SEATUNNEL_HOME:-/opt/soft/seatunnel} # export CHUNJUN_HOME=${CHUNJUN_HOME:-/opt/soft/chunjun} export PATH=$HADOOP_HOME/bin:$SPARK_HOME1/bin:$SPARK_HOME2/bin:$PYTHON_HOME/bin:$JAVA_HOME/bin:$HIVE_HOME/bin:$FLINK_HOME/bin:$DATAX_HOME/bin:$SEATUNNEL_HOME/bin:$CHUNJUN_HOME/bin:$PATH
1、 初始化数据库完成时,打印的日志最后一行会生成临时密码,使用临时密码登录。
mysql> alter user root@'localhost' identified with mysql_native_password by '新密码';
mysql> flush privileges;
2、 创建数据库dolphinscheduler用户。
$ /dolphinscheduler/liutt/mysql_db/bin/mysql -u root -p '新密码'
mysql> set global validate_password.policy='LOW'; #低强度密码,可选设置
mysql> set global validate_password.length=4; #密码长度最低4位,可选设置
mysql> create user dolphinscheduler@'%' identified with mysql_native_password by 'xxxx';
mysql> create user dolphinscheduler@'localhost' identified with mysql_native_password by 'xxxx';
3、 为dolphinscheduler用户赋予访问数据库权限。
mysql> grant all privileges on *.* to dolphinscheduler@'localhost';
mysql> grant all privileges on *.* to dolphinscheduler@'%';
mysql> flush privileges;
4、 测试用dsg用户登录数据库。
$ mysql -h192.xxx.x.xx -P3307 -udolphinscheduler -p
create user dolphinscheduler@'%' identified with mysql_native_password by 'dolphinscheduler';
create user dolphinscheduler@'%' identified with mysql_native_password by 'dolphinscheduler';
create user dolphinscheduler@'172.xx.x.xxx' identified with mysql_native_password by 'dolphinscheduler';
grant all privileges on *.* to dolphinscheduler@'localhost';
grant all privileges on *.* to dolphinscheduler@'%';
grant all privileges on *.* to dolphinscheduler@'172.xx.x.xxx';
flush privileges;
如果使用 MySQL 需要手动下载 mysql-connector-java 驱动 (8.0.16) 并移动到 DolphinScheduler 的每个模块的 libs 目录下,其中包括 :
不然会报错 Caused by: java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver
命令:修改过的安装包(apache-dolphinscheduler-3.1.1-SNAPSHOT-bin.tar.gz)由于windows和linux格式不一致问题,需要修改格式。
sudo yum install -y dos2unix
将当前目录所有文件格式都转为unix:find . -type f -exec dos2unix {} ;
修改一个文件的格式命令:
直接在各节点海豚主目录下执行修改所有文件即可
最后执行 tools/bin/upgrade-schema.sh 如下图所示
bash ./bin/install.sh
在HDFS上添加对应目录,并将权限给到海豚用户,并在对应配置文件中添加资源路径
在master/worker/api/alert conf/common. properties 文件中路径信息对应
#本地工作目录,用于存放临时文件 data.basedir.path=/tmp/dolphinscheduler_3.1.1 resource.storage.type=HDFS #资源文件存储路径 resource.storage.upload.base.path=/user/rtassets/dolphinscheduler_3.1.1 resource.aws.access.key.id=minioadmin resource.aws.secret.access.key=minioadmin resource.aws.region=cn-north-1 resource.aws.s3.bucket.name=dolphinscheduler resource.aws.s3.endpoint=http://localhost:9000 resource.alibaba.cloud.access.key.id=<your-access-key-id> resource.alibaba.cloud.access.key.secret=<your-access-key-secret> resource.alibaba.cloud.region=cn-hangzhou resource.alibaba.cloud.oss.bucket.name=dolphinscheduler resource.alibaba.cloud.oss.endpoint=https://oss-cn-hangzhou.aliyuncs.com # 如果存储类型为HDFS,需要配置拥有对应操作权限的用户 resource.hdfs.root.user=hdfs resource.hdfs.fs.defaultFS=hdfs://nameservice1:8020 hadoop.security.authentication.startup.state=true java.security.krb5.conf.path=/etc/krb5.conf login.user.keytab.username=rtassets@CINDASC.COM login.user.keytab.path=/home/rtassets/rtassets.keytab kerberos.expire.time=2 resource.manager.httpaddress.port=8088 yarn.resourcemanager.ha.rm.ids=192.168.xx.xx,192.168.xx.xx yarn.application.status.address=http://ds1:%s/ws/v1/cluster/apps/%s yarn.job.history.status.address=http://ds1:19888/ws/v1/history/mapreduce/jobs/%s datasource.encryption.enable=false datasource.encryption.salt=!@#$%^&* data-quality.jar.name=dolphinscheduler-data-quality-dev-SNAPSHOT.jar #不清楚这个参数 support.hive.oneSession=false sudo.enable=true development.state=false alert.rpc.port=50052 conda.path=/opt/anaconda3/etc/profile.d/conda.sh task.resource.limit.state=false ml.mlflow.preset_repository=https://github.com/apache/dolphinscheduler-mlflow ml.mlflow.preset_repository_version="main"
Crontab定时配置 :crontab -e
10 9,10 * * * kinit -kt /home/rtassets/rtassets.keytab rtassets@CINDASC.COM
需要如下包:(如下所示的包是适配apache-dolphinscheduler-3.1.1-SNAPSHOT-bin.tar.gz)
连接数据源没问题,跑hiveClient不会出现版本不匹配问题
如下是包版本冲突出现的问题,需要修改如上图所示的包
版本冲突错误:
修改MySQL中的源端信息表 t_ds_resources
在海豚上导入工作流的时候,如果没有修改id,那么导入的工作流里面的不会识别资源目录,并且跑任务的时候也会识别不到id。(如下图是修改id后导入工作流自动识别,如果导入后没有识别资源目录,说明没有识别到id,运行起来有问题)
admin
dolphinscheduler123
登陆后需要创建租户,用户。海豚租户名称需要和本地keytab认证的用户名称保持一致。租户对应下的用户名称没有要求。
jdbc连接参数
{“KrbServiceName”:“hive”,“KrbAuthType”:“2”}
如下图所示
否则执行回报如下错误
由于生产环境资源问题,ods层工作流之间配置成串行执行,包括dwd层的也依赖ods层,目前海豚在工作流导出再导如过程,依赖节点元数据id会发生改变,导致从测试环境导出的工作流再导入生产环境,无法运行起来,所以在生产环境中的DEPENDENT类型节点需要手动再设置一次
为了解决定时任务在定义了参数以后,不能调度的问题, 替换掉了每台服务器各个模块下的 jar:dolphinscheduler-service-3.1.1-SNAPSHOT.jar
告警是在213上布置的,所以在213下设置相关包即可,否则会在web页面告警实例中出现无法找到告警组件的情况。
需要如下图所示包:所属用户所属组改成海豚用户
Admin用户下,创建告警实例
然后创建告警组,选中该实例
然后在运行时选择告警租和策略
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。