【发布时间】:2019-11-29 15:45:56
【问题描述】:
我使用stable/airflow helm 图表在 Kubernetes 上部署了一个 Airflow 实例。我稍微修改了puckel/docker-airflow 映像,以便能够安装 Kubernetes 执行器。现在所有任务都在我们的 Kubernetes 集群上成功执行了,但是这些任务的日志却找不到了。
我想将日志上传到我们的 Azure Blob 存储帐户。我已经像这样配置了我的环境变量:
AIRFLOW__CORE__REMOTE_BASE_LOG_FOLDER="wasb-airflow"
AIRFLOW__CORE__REMOTE_LOG_CONN_ID="wasb_default"
AIRFLOW__CORE__REMOTE_LOGGING="True"
wasb_default 连接包括 Azure Blob 存储帐户的登录名和密码。我已经使用WasbHook 测试了这个连接,并且能够成功删除一个虚拟文件。
当我尝试查看日志时,会显示以下消息:
*** Log file does not exist: /usr/local/airflow/logs/example_python_operator/print_the_context/2019-11-29T15:42:25+00:00/1.log
*** Fetching from: http://examplepythonoperatorprintthecontext-4a6e6a1f11fd431f8c2a1dc081:8793/log/example_python_operator/print_the_context/2019-11-29T15:42:25+00:00/1.log
*** Failed to fetch log file from worker. HTTPConnectionPool(host='examplepythonoperatorprintthecontext-4a6e6a1f11fd431f8c2a1dc081', port=8793): Max retries exceeded with url: /log/example_python_operator/print_the_context/2019-11-29T15:42:25+00:00/1.log (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f34ecdbe990>: Failed to establish a new connection: [Errno -2] Name or service not known'))
关于如何解决这个问题的任何想法?
【问题讨论】:
-
尝试连接容器,检查日志文件是否真的存在。日志文件路径由 dag-name、task-name、运行日期等组合而成。可能其中一些属性已更改。
-
日志文件存在于容器中,但不在我的 Azure 存储中。我认为问题是 Airflow 无法到达正在运行的容器内的日志
标签: azure logging kubernetes airflow