【问题标题】:Airlow logs are not visible气流日志不可见
【发布时间】: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


    【解决方案1】:

    那是因为您的容器无法访问日志文件。它应该与您的网络或安全组配置有关。我建议在您的 ECS 设置中检查这两个配置。

    干杯:)

    【讨论】:

    • 能说说配置吗
    • Geetika - 您需要与配置您的 AWS 基础设施的团队交谈/工作,他们会有一个好主意。如果您自己做 - 我建议转到 EC2->安全组并检查您的安全组设置。
    • 我自己做...即使我允许来自任何地方的所有流量,我也无法访问。我认为主机名解析存在一些问题。 ec2 无法识别 ip-10-180-98-37.eu-west-1.compute.internal。我仍然无法解决这个问题。请协助。
    猜你喜欢
    • 2019-02-21
    • 2020-05-08
    • 2017-02-28
    • 2021-04-17
    • 1970-01-01
    • 2019-05-18
    • 2022-12-15
    • 1970-01-01
    • 2022-10-11
    相关资源
    最近更新 更多