Apache DolphinScheduler单机安装步骤

时间:2024-02-16 10:34:51

1所需条件

1)mysql数据库

2)jdk 1.8以上

3) zookeeper

2,下载最新的tar.gz包

sit环境用的是这个版本:apache-dolphinscheduler-incubating-1.2.1-dolphinscheduler-bin.tar.gz

创建用户:

# add user escheduler
useradd escheduler;
 
# modify user password
echo "escheduler" | passwd --stdin escheduler
 
# 配置sudo免密
sed -i \'$aescheduler  ALL=(ALL)  NOPASSWD: NOPASSWD: ALL\' /etc/sudoers
 
# 修改目录权限,使得部署用户对dolphinscheduler目录有操作权限 
chown -R escheduler:escheduler dolphinscheduler
tar -zxvf apache-dolphinscheduler-incubating-1.2.1-dolphinscheduler-bin.tar.gz

mv apache-dolphinscheduler-incubating-1.2.1-dolphinscheduler-bin  dolphinscheduler

3,ssh免密登录

 
su escheduler;
 
ssh-keygen -t rsa -P \'\' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

4,修改数据库的链接:改成你所需要的链接

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://xxxx:3306/dolphinscheduler?characterEncoding=utf8
spring.datasource.username=xxx
spring.datasource.password=xxxxx

5,修改java的软连接

sudo ln -s /opt/soft/java/bin/java /usr/bin/java

6,修改install.sh,单机配置参考如下

# for example postgresql or mysql ...
dbtype="mysql"
 
# db config
# db address and port
dbhost="xxxxxxxxxx:3306"
 
# db name
dbname="dolphinscheduler"
 
# db username
username="xxxx"
 
# db passwprd
# Note: if there are special characters, please use the \ transfer character to transfer
passowrd="xxxxx"
 
# conf/config/install_config.conf config
# Note: the installation path is not the same as the current path (pwd)
installPath="/data1_1T/dolphinscheduler"
 
# 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="escheduler"
 
# zk cluster
zkQuorum="xxxx:2181"
 
# install hosts
# Note: install the scheduled hostname list. If it is pseudo-distributed, just write a pseudo-distributed hostname
ips="localhost"
 
# 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="localhost"
 
# run worker machine
# note: list of machine hostnames for deploying workers
workers="localhost"
 
# run alert machine
# note: list of machine hostnames for deploying alert server
alertServer="localhost"
 
# run api machine
# note: list of machine hostnames for deploying api server
apiServers="localhost"

7,安装python的zookeeper工具kazoo

 
#安装pip
sudo yum -y install python-pip;  #ubuntu请使用 sudo apt-get install python-pip
sudo pip install kazoo;

8,执行部署命令

sh install.sh

9,验证是否启动

ps -ef|grep java

eschedu+  2753     1  1 15:45 ?        00:01:06 /usr/java/jdk1.8.0_144/bin/java -Dlogging.config=classpath:master_logback.xml -Ddruid.mysql.usePingMethod=false -server -Xmx16g -Xms4g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -classpath /data1_1T/dolphinscheduler/bin/../conf:/data1_1T/dolphinscheduler/bin/../lib/* org.apache.dolphinscheduler.server.master.MasterServer
eschedu+  2818     1  0 15:45 ?        00:00:31 /usr/java/jdk1.8.0_144/bin/java -Dlogging.config=classpath:worker_logback.xml -Ddruid.mysql.usePingMethod=false -server -Xmx16g -Xms4g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -classpath /data1_1T/dolphinscheduler/bin/../conf:/data1_1T/dolphinscheduler/bin/../lib/* org.apache.dolphinscheduler.server.worker.WorkerServer
eschedu+  2925     1  0 15:45 ?        00:00:03 /usr/java/jdk1.8.0_144/bin/java -server -Xmx16g -Xms4g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -classpath /data1_1T/dolphinscheduler/bin/../conf:/data1_1T/dolphinscheduler/bin/../lib/* org.apache.dolphinscheduler.server.rpc.LoggerServer
eschedu+  3059     1  1 15:45 ?        00:00:51 /usr/java/jdk1.8.0_144/bin/java -Dlogging.config=classpath:apiserver_logback.xml -Dspring.profiles.active=api -server -Xmx16g -Xms4g -Xss512k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -classpath /data1_1T/dolphinscheduler/bin/../conf:/data1_1T/dolphinscheduler/bin/../lib/* org.apache.dolphinscheduler.api.ApiApplicationServer

登录页面

http://192.168.xx.xx:12345/dolphinscheduler
admin/dolphinscheduler123

10,其他常见问题

1)密码输入错误

如果登录不对,将sql/dolphinscheduler_mysql.sql中的

INSERT INTO `t_ds_user` VALUES (1, \'admin\', \'7ad2410b2f4c074479a8937a28a22b8f\', 0, \'xxx@qq.com\', \'xx\', 0, \'2018-03-27 15:48:50\', \'2018-10-24 17:40:22\', NULL);

再次导入数据库就可以了

2)java.sql.SQLException: null,  message from server: "Host \'x.x.x.x\' is blocked because of many connection errors; unblock with \'mysqladmin flush-hosts\'"

2.1)直接修改mysql的show global variables like \'%max_connect_errors%\';,直接修改max_connect_errors的数量

2.2)进入mysql的控制台,flush hosts 刷新下所有的host 

3)服务启动,停止

sh start-all.sh

sh stop-all.sh

4)/data1_1T/dolphinscheduler 赋予escheduler权限