栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

AirFlow 作业管理学习

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/423642.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号