ubuntu - 气流 DAG 文件夹不可见
问题描述
我刚刚在 ubuntu 中安装了 Airflow,我正在按照教程创建 DAG。成功安装气流后,我dags
在气流主页中创建了文件夹,并创建了一个示例 DAG 文件为sample.py
. 但我实际上没有看到 dags 文件夹
yash@DESKTOP-TUTMG4J:~/airflow$ ls -l
total 316
-rw-rw-rw- 1 yash yash 0 Jun 12 19:26 airflow-webserver.err
-rw-rw-rw- 1 yash yash 140 Jun 12 19:29 airflow-webserver.log
-rw-rw-rw- 1 yash yash 222 Jun 12 19:29 airflow-webserver.out
-rw-r--r-- 1 yash yash 5 Jun 13 14:53 airflow-webserver.pid
-rw-rw-rw- 1 yash yash 36462 Jun 12 17:02 airflow.cfg
-rw-r--r-- 1 yash yash 270336 Jun 13 14:54 airflow.db
drwxrwxrwx 1 yash yash 512 Jun 12 21:57 logs
-rw-rw-rw- 1 yash yash 2578 Jun 12 17:02 unittests.cfg
yash@DESKTOP-TUTMG4J:~/airflow$
但是当我开始airflow webserver
它说Filling up the DagBag from /home/yash/airflow/dags
yash@DESKTOP-TUTMG4J:~/airflow$ airflow initdb
DB: sqlite:////home/yash/airflow/airflow.db
[2020-06-13 14:51:35,133] {db.py:378} INFO - Creating tables
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Done.
yash@DESKTOP-TUTMG4J:~/airflow$ airflow webserver
____________ _____________
____ |__( )_________ __/__ /________ __
____ /| |_ /__ ___/_ /_ __ /_ __ \_ | /| / /
___ ___ | / _ / _ __/ _ / / /_/ /_ |/ |/ /
_/_/ |_/_/ /_/ /_/ /_/ \____/____/|__/
[2020-06-13 14:53:22,260] {__init__.py:51} INFO - Using executor SequentialExecutor
[2020-06-13 14:53:22,260] {dagbag.py:396} INFO - Filling up the DagBag from /home/yash/airflow/dags
Running the Gunicorn Server with:
Workers: 4 sync
Host: 0.0.0.0:8080
Timeout: 120
Logfiles: - -
=================================================================
[2020-06-13 14:53:23 +0530] [5308] [INFO] Starting gunicorn 19.4.0
[2020-06-13 14:53:23 +0530] [5308] [INFO] Listening at: http://0.0.0.0:8080 (5308)
[2020-06-13 14:53:23 +0530] [5308] [INFO] Using worker: sync
[2020-06-13 14:53:23 +0530] [5313] [INFO] Booting worker with pid: 5313
[2020-06-13 14:53:23 +0530] [5314] [INFO] Booting worker with pid: 5314
[2020-06-13 14:53:23 +0530] [5315] [INFO] Booting worker with pid: 5315
[2020-06-13 14:53:23 +0530] [5327] [INFO] Booting worker with pid: 5327
[2020-06-13 14:53:23,678] {__init__.py:51} INFO - Using executor SequentialExecutor
[2020-06-13 14:53:23,679] {dagbag.py:396} INFO - Filling up the DagBag from /home/yash/airflow/dags
[2020-06-13 14:53:23,836] {__init__.py:51} INFO - Using executor SequentialExecutor
[2020-06-13 14:53:23,837] {dagbag.py:396} INFO - Filling up the DagBag from /home/yash/airflow/dags
[2020-06-13 14:53:23,949] {__init__.py:51} INFO - Using executor SequentialExecutor
当然,我也没有在气流 UI 中看到我的 DAG。有人可以告诉我我做错了什么以及气流如何从文件夹中挑选我的 DAGS。
解决方案
看起来您实际上并没有dags
在 Airflow 的主目录中创建目录。在您的情况下,气流的家是/home/yash/airflow/
,显然dags
那里没有目录。
Airflow 的日志消息Filling up the DagBag from /home/yash/airflow/dags
可能有些误导。这实际上意味着 Airflows 正在该路径下寻找 DAG 脚本,但这并不意味着该路径存在。
创建目录:
mkdir /home/yash/airflow/dags
并尝试再次创建 DAG 脚本。
推荐阅读
- jenkins - 如何使用 Junit 在 Jenkins 中显示 Angular Lint 输出?
- c++ - 如果使用 QToolTip::showText,QToolTip 样式表不起作用
- google-compute-engine - 我的谷歌云实例失去了网络连接
- thymeleaf - Spring Roo 细节对象
- css - 我可以水平排列 Flexbox 列中的对象吗?
- python - 用于计算跨列矩阵的二阶范数的 numpy 文档是否有点误导?
- angular - 将 promise 与 observable 合并
- reactjs - react-boostrap-typeahead 使用 formik 重置
- robotframework - 为测试用例生成 Robot Framework 文档
- java - EHCache 在 getCache 之后返回 null