【发布时间】:2021-03-03 11:14:17
【问题描述】:
我已经在 AWS ECS 上部署了气流集群。 Airflow Webserver、Scheduler 和 worker 运行在不同容器下的同一主机上。
当我尝试使用 Airflow 网络服务器获取日志时,出现以下错误:
*** Log file does not exist: /usr/local/airflow/logs/master_populate_uc_crf_ap/populate_ss_ui_schema__country/2021-03-03T09:54:53.271590+00:00/1.log
*** Fetching from: http://ip-10-180-98-37.eu-west-1.compute.internal:8793/log/master_populate/populate_schema/2021-03-03T09:54:53.271590+00:00/1.log
*** Failed to fetch log file from worker. HTTPConnectionPool(host='ip-10-180-98-37.eu-west-1.compute.internal', port=8793): Max retries exceeded with url: /log/master_populate/populate_schema/2021-03-03T09:54:53.271590+00:00/1.log (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52eae32e10>: Failed to establish a new connection: [Errno -2] Name or service not known'))
如果我登录到运行所有三个(Webserver、调度程序和工作者)容器的 ec2,我可以成功运行以下命令:
curl http://ip-10-180-98-37.eu-west-1.compute.internal:8793/log/master_populate/populate_schema/2021-03-03T09:54:53.271590+00:00/1.log
它确认正在生成日志,但 Webserver 无法从 worker 访问日志。
如果我登录到 Webserver docker 容器并运行相同的 curl 命令,则会发生以下错误:
curl: (6) Could not resolve host: ip-10-180-98-37.eu-west-1.compute.internal
如果我用 localhost 替换主机名(ip-10-180-98-37.eu-west-1.compute.internal),那么 curl 将在 Webserver 容器下成功运行。 以下是气流配置变量的值:
AIRFLOW__CORE__HOSTNAME_CALLABLE: socket:getfqdn
executor = SequentialExecutor
网络模式是主机。 请协助。
【问题讨论】:
标签: amazon-web-services airflow amazon-ecs