Airflow1.8 分布式工作流平台搭建

版本信息:

python 2.7.15
airflow==1.8.0
SQLAlchemy==1.1.18
flower==0.9.2

其中SQLAlchemy的版本如果是1.2.x版本会在创建用户是报错,

[root@localhost ~]# python2 create_user.py 
[2018-07-18 18:51:09,336] {__init__.py:57} INFO - Using executor CeleryExecutor
Traceback (most recent call last):
  File "create_user.py", line 7, in <module>
    user.password = 'afuser'
  File "/soft/anaconda2/lib/python2.7/site-packages/sqlalchemy/ext/hybrid.py", line 873, in __set__
    raise AttributeError("can't set attribute")
AttributeError: can't set attribute

使用pip安装airflow,celery,此外

  • 需要使用rabbitmq作为celery的backend需要pip install airflow[rabbitmq]
  • 需要登录认证时pip install airflow[password]
  • 需要使用CeleryExecutor时install apache-airflow[celery]

说明文档参考Extra Packages

airflow默认使用sqlite作为Airflow后台数据库,这里我改成mysql:

首先pip install airflow[mysql]

这里先设置airflow的环境变量AIRFLOW_HOME,

vim /etc/profile
加入export AIRFLOW_HOME=/home/crawl/airflow
然后执行
source /etc/profile
使生效

否则airflow会在当前用户的家目录下生成airflow文件夹

然后执行airflow,就会在$AIRFLOW_HOME下生成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值