首先安装命令为:
pip install airflow
也可以:
pip install airflow[参数]
参数如下:
subpackage | install command | enables |
---|---|---|
all | pip install airflow[all] | All Airflow features known to man |
all_dbs | pip install airflow[all_dbs] | All databases integrations |
async | pip install airflow[async] | Async worker classes for gunicorn |
devel | pip install airflow[devel] | Minimum dev tools requirements |
devel_hadoop | pip install airflow[devel_hadoop] | Airflow + dependencies on the Hadoop stack |
celery | pip install airflow[celery] | CeleryExecutor |
crypto | pip install airflow[crypto] | Encrypt connection passwords in metadata db |
druid | pip install airflow[druid] | Druid.io related operators & hooks |
gcp_api | pip install airflow[gcp_api] | Google Cloud Platform hooks and operators (using google-api-python-client ) |
jdbc | pip install airflow[jdbc] | JDBC hooks and operators |
hdfs | pip install airflow[hdfs] | HDFS hooks and operators |
hive | pip install airflow[hive] | All Hive related operators |
kerberos | pip install airflow[kerberos] | kerberos integration for kerberized hadoop |
ldap | pip install airflow[ldap] | ldap authentication for users |
mssql | pip install airflow[mssql] | Microsoft SQL operators and hook, support as an Airflow backend |
mysql | pip install airflow[mysql] | MySQL operators and hook, support as an Airflow backend |
password | pip install airflow[password] | Password Authentication for users |
postgres | pip install airflow[postgres] | Postgres operators and hook, support as an Airflow backend |
qds | pip install airflow[qds] | Enable QDS (qubole data services) support |
rabbitmq | pip install airflow[rabbitmq] | Rabbitmq support as a Celery backend |
s3 | pip install airflow[s3] | S3KeySensor , S3PrefixSensor |
samba | pip install airflow[samba] | Hive2SambaOperator |
slack | pip install airflow[slack] | SlackAPIPostOperator |
vertica | pip install airflow[vertica] | Vertica hook support as an Airflow backend |
cloudant | pip install airflow[cloudant] | Cloudant hook |
可以直接使用:
pip install airflow[all]
这样就可以安装所有依赖的东西,
配置环境变量:
export AIRFLOW_HOME=~/airflow
配置mysql数据库存储airflow信息:
sql_alchemy_conn = mysql://user:password@ip:port/airflow
初始化数据库:
airflow initdb
启动Web Server,指定端口:
airflow webserver –p 18080
安装成功界面:
后台显示:
OK,在默认的配置下可以玩了,如果需要将airflow的数据保存到数据库的话,就可以配置一下保存到数据库。