【问题标题】:web server of airflow is not running气流的网络服务器未运行
【发布时间】:2018-06-09 14:40:08
【问题描述】:

m 在 Django 的 Airflow 中配置电子邮件调度程序,但它不起作用。

终端错误:

airflow webserver
[2017-12-29 10:52:17,614] {__init__.py:57} INFO - Using executor SequentialExecutor
[2017-12-29 10:52:17,734] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
[2017-12-29 10:52:17,765] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
  ____________       _____________
 ____    |__( )_________  __/__  /________      __
____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /| / /
___  ___ |  / _  /   _  __/ _  / / /_/ /_ |/ |/ /
 _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/

/usr/local/lib/python3.5/dist-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
  .format(x=modname), ExtDeprecationWarning
[2017-12-29 10:52:18,354] [8169] {models.py:167} INFO - Filling up the DagBag from /home/hitesh/airflow/dags
Running the Gunicorn Server with:
Workers: 4 sync
Host: 0.0.0.0:8080
Timeout: 120
Logfiles: - -
=================================================================            

Error: 'airflow.www.gunicorn_config' doesn't exist

【问题讨论】:

    标签: django python-3.x apache-airflow airflow-scheduler


    【解决方案1】:

    Airflow(经过测试的 v1.8.0)不适用于 gunicorn 19.4+,原因如下: http://mail-archives.apache.org/mod_mbox/airflow-commits/201708.mbox/%3CJIRA.13063358.1491960900000.100006.1501939203227@Atlassian.JIRA%3E

    使用此命令pip install gunicorn==19.3.0 降级 gunicorn 后它应该可以工作

    【讨论】:

    • 我只在不使用 virtualenv 时遇到了这个问题。如果没有 virtualenv,在 apache-airflow==1.9.0 和 pip 18.1 上切换到 gunicorn==19.3.0 对我不起作用。根据您安装气流的位置(例如,带或不带虚拟环境),您可能会在以下位置找到气流:/home/will/.local/lib/python2.7/site-packages/airflow/www/gunicorn_config.py。即使从站点包中运行气流网络服务器也不起作用。
    【解决方案2】:

    使用sudo pip install airflow==1.8重新安装包

    它将解决包问题。

    【讨论】:

      【解决方案3】:

      尝试运行sudo airflow webserver 而不是airflow webserver。它帮助我解决了这个问题。

      【讨论】:

      • 这确实有效,但有趣的是为什么即使您在虚拟环境中也需要 sudo。
      • 即使没有 virtuaenv,我也被卡住了……谢谢它的魅力。
      【解决方案4】:

      我没有使用 Django,但遇到了同样的问题。我通过在气流源代码上应用 pr 的更改解决了这个问题。即用绝对路径替换gunicorn命令。

      我在Python 3.6.0airflow 1.10.0gunicorn 19.9.0 下。希望这会有所帮助。

      【讨论】:

        【解决方案5】:

        解决问题的步骤:

        • 安装 guiicorn 19.9.0
        • 运行:

          独角兽在哪里

        • 用最近安装的软链接替换 ​​/usr/bin/gunicorn,在我的例子中:

          [airflow@foo airflow]$ sudo mv /usr/bin/gunicorn /usr/bin/gunicorn_old [airflow@foo airflow]$ sudo ln -s /opt/anaconda3.5/bin/gunicorn /usr/bin/gunicorn [airflow@foo airflow]$ /opt/anaconda3.5/bin/gunicorn --version gunicorn (version 19.9.0)

        • 在我的例子中,启动指向 1.10.0 的气流网络服务器:

          nohup /opt/anaconda3.5/bin/airflow webserver & nohup /opt/anaconda3.5/bin/airflow scheduler &

        如果出现以下情况,这将解决问题:

        1. guicorn 显示不同的值
        2. Linux guicorn 可执行文件与版本不同 安装在气流装置中。

        希望对你有帮助

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2021-03-06
          • 1970-01-01
          • 2021-06-12
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多