dophinscheduler单机伪集群模式安装

1.jdk 安装 Oracle 官网下载 jdk8
rmp -ivh 

2.CentOS7 安装 Mysql8 
yum install wget 

删除默认的mariadb

添加MySQL yum 源
wget https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm

sudo rpm -Uvh mysql80-community-release-el7-7.noarch.rpm

yum install mysql-community-server

systemctl start mysql

-- 开机启动
systemctl enable mysqld

-- 获取MySQL临时密码
cat /var/log/mysqld.log | grep  passwd

登录mysql 修改秘密
mysql -uroot -p

alter user root@'localhost' identified by 'xxx';

创建dolphinschedual 数据库
mysql -uroot -p


关掉强密码认证
set global validate_password.policy=0

CREATE DATABASE dolphinscheduler DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

mysql> CREATE USER 'dolphin'@'%' IDENTIFIED BY 'xxx';
mysql> GRANT ALL PRIVILEGES ON dolphinscheduler.* TO 'dolphin'@'%';
mysql> CREATE USER 'dolphin'@'localhost' IDENTIFIED BY 'xxxx';
mysql> GRANT ALL PRIVILEGES ON dolphinscheduler.* TO 'dolphin'@'localhost';
mysql> FLUSH PRIVILEGES;

3.准备 DolphinScheduler 启动环境
a.创建用户
    useradd dolphinscheduler
    echo "xxxx" | passwd --stdin dolphinscheduler

    scp root@192.168.0.130:/home/oracle/apache-dolphinscheduler-3.1.3-bin.tar.gz /home/dolphinscheduler/

下载Apache Zookeeper
https://dlcdn.apache.org/zookeeper/zookeeper-3.8.0/apache-zookeeper-3.8.0-bin.tar.gz


b.配置sudo免密
sed -i '$adolphinscheduler  ALL=(ALL)  NOPASSWD: NOPASSWD: ALL' /etc/sudoers
sed -i 's/Defaults    requirett/#Defaults    requirett/g' /etc/sudoers

c.修改目录权限,使得部署用户对二进制包解压后的 apache-dolphinscheduler-*-bin 目录有操作权限
chown -R dolphinscheduler:dolphinscheduler apache-dolphinscheduler-*-bin

d.配置机器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

4.修改install_env.sh 
# ---------------------------------------------------------
# INSTALL MACHINE
# ---------------------------------------------------------
# Due to the master, worker, and API server being deployed on a single node, the IP of the server is the machine IP or localhost
ips="localhost"
sshPort="22"
masters="localhost"
workers="localhost:default"
alertServer="localhost"
apiServers="localhost"

# DolphinScheduler installation path, it will auto-create if not exists
installPath=~/dolphinscheduler

# Deploy user, use the user you create in section **Configure machine SSH password-free login**
deployUser="dolphinscheduler"

5.修改dolphinscheduler_env.sh 
# JAVA_HOME, will use it to start DolphinScheduler server
export JAVA_HOME=${JAVA_HOME:-/opt/soft/java}

# Database related configuration, set database type, username and password
export DATABASE=${DATABASE:-mysql}
export SPRING_PROFILES_ACTIVE=${DATABASE}
export SPRING_DATASOURCE_URL="jdbc:mysql://localhost:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&useSSL=false"
export SPRING_DATASOURCE_USERNAME=xxxx
export SPRING_DATASOURCE_PASSWORD=xxx

# DolphinScheduler server related configuration
export SPRING_CACHE_TYPE=${SPRING_CACHE_TYPE:-none}
export SPRING_JACKSON_TIME_ZONE=${SPRING_JACKSON_TIME_ZONE:-UTC}
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:-localhost:2181}

# Tasks related configurations, need to change the configuration if you use the related tasks.
export HADOOP_HOME=${HADOOP_HOME:-/opt/soft/hadoop}
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-/opt/soft/hadoop/etc/hadoop}
export SPARK_HOME1=${SPARK_HOME1:-/opt/soft/spark1}
export SPARK_HOME2=${SPARK_HOME2:-/opt/soft/spark2}
export PYTHON_HOME=${PYTHON_HOME:-/opt/soft/python}
export HIVE_HOME=${HIVE_HOME:-/opt/soft/hive}
export FLINK_HOME=${FLINK_HOME:-/opt/soft/flink}
export DATAX_HOME=${DATAX_HOME:-/opt/soft/datax}

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:$PATH


6.初始化数据库
bash tools/bin/upgrade-schema.sh
7.暴露12345端口
firewall-cmd --zone=public --permanent --add-port=12345/tcp
firewall-cmd --list-ports --permanent
firewall-cmd --reload
systemctl restart firewalld

8.登录地址 http://localhost:12345/dolphinscheduler/ui

  

posted @ 2023-02-10 11:23  Alex-Zeng  阅读(109)  评论(0编辑  收藏  举报