airflow 安装步骤
因为python2.7各种版本的问题,所以最终使用 python3.6
1、下载anaconda3
2、通过conda 创建虚拟环境
3、根据airflow 的官方文档 Quick Start, 部署demo
文档 URL: http://airflow.apache.org/start.html
-- 将数据存储从sqlite变成mysql
4、安装mysql
文档 URL: https://dinfratechsource.com/2018/11/10/how-to-install-latest-mysql-5-7-21-on-rhel-centos-7/
5、设置mysql
a.在my.cnf中的[mysqld]下,加入 explicit_defaults_for_timestamp=1
b.在mysql 中创建一个airflow的库
6、修改airflow 的airflow.cfg文件 参考官方文档的 Initializing a Database Backend
文档 URL: http://airflow.apache.org/howto/initialize-database.html
主要涉及2点:
a.修改 airflow.cfg 文件中的 executor, 将其值修改为 LocalExecutor
b.修改 airflow.cfg 文件中的 sql_alchemy_conn,
将其值修改为 mysql+pymysql://username:password@ip:port/airflow
7、启动airflow
遇到的坑:
如果出现启动airflow webserver的时候出现 “FileNotFoundError: [Errno 2] No such file or directory: 'gunicorn': 'gunicorn' ”的错误信息
1)可以尝试先删除gunicorn : pip uninstall gunicorn
2)重新下载 gunicorn: pip uninstall gunicorn
3) 启动airflow webserver

浙公网安备 33010602011771号