1、安装python3(存在则略过)
https://blog.csdn.net/Beyond_F4/article/details/79724850 # 虚拟环境 https://blog.csdn.net/Beyond_F4/article/details/122251675
2、安装MySQL(存在则略过)
https://blog.csdn.net/huangmx1995/article/details/52909580 1# 安装后创建airflow数据库 CREATE DATAbase airflow; 2# 修改配置文件 vi /etc/my.cnf 加入一行 [mysqld] explicit_defaults_for_timestamp=1 或者在数据库命令行运行 set @@global.explicit_defaults_for_timestamp=on;
3、安装python3包
pip3 install --upgrade pip pip3 install pymysql pip3 install airflow pip3 install paramiko
4、安装airflow依赖环境
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
5、在/etc/profile中末尾配置airflow环境变量
#airflow export AIRFLOW_HOME=/software/airflow
6、初始化
airflow initdb 如果失败,则用 airflow db init
成功后则会在/software/airflow/目录下生成文件
airflow.cfg airflow.db logs unittests.cfg webserver_config.py
7、创建登录用户:
(venv) [root@localhost airflow]# airflow users create --username admin --firstname admin --lastname admin --role Admin --email xxx@163.com
回车提示输入密码
看到如下提示,则创建成功
Password:
Repeat for /confirm/iation:
[2022-03-17 08:27:44,763] {manager.py:214} INFO - Added user admin
User "admin" created with role "Admin"
8、启动airflow
airflow webserver airflow scheduler 默认启动服务器localhost,默认端口8080, 如需修改服务器ip和端口,打开文件/software/airflow/airflow.cfg 修改host、port



