AirFlow 作业管理学习

Linux环境(或者Windows下的Linux环境,Windows环境有问题 termios或者  pwd 插件安装不了)

创建项目目录,创建Python虚拟环境
mkdir -p ~/airflow
cd airflow
python3 -m venv myvenv
. myvenv/bin/activate
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
参考:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

安装AirFlow
export AIRFLOW_HOME=~/airflow
export SLUGIFY_USES_TEXT_UNIDECODE=yes
pip install apache-airflow
 
初始化AirFlow数据库(SQLLite数据库)
# initialize the database
airflow db init
 
# start the web server, default port is 8080
airflow webserver -p 8082 &
 
# start the scheduler
airflow scheduler &

# 创建用户
参考:
https://airflow.apache.org/docs/apache-airflow/stable/start/local.html
airflow users create \
    --username admin \
    --firstname Peter \
    --lastname Parker \
    --role Admin \
    --email spiderman@superhero.org
    
http://192.168.1.4:8082/
DAG Import Errors (2)
Do not use SQLite as metadata DB in production – it should only be used for dev/testing We recommend using Postgres or MySQL. Click here for more information.
Do not use SequentialExecutor in production. Click here for more information.

网上老的写法例子不能用
2.0 新的写法:
with DAg()
as dag;

重点:
dags 目录 例子代码(博士)
例子代码 localhost:8080查看
api查看测试 http://localhost:8080/api/v1/users
Firefox安装 扩展:RESTED(A REST client for the rest of us),进行API测试

参考:
Airflow Python工作流引擎的重要概念介绍
https://blog.csdn.net/watermelonbig/article/details/82585196

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值