啟動airflow webserver報錯:FileNotFoundError: [Errno 2] No such file or directory: 'gunicorn'


啟動airflow websever時報錯,FileNotFoundError: [Errno 2] No such file or directory: 'gunicorn' ,找不到gunicorn。

  1: $airflow webserver
  2: [2017-06-30 19:06:15,381] {__init__.py:57} INFO - Using executor SequentialExecutor
  3:   ____________       _____________
  4:  ____    |__( )_________  __/__  /________      __
  5: ____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /| / /
  6: ___  ___ |  / _  /   _  __/ _  / / /_/ /_ |/ |/ /
  7:  _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/
  8:  
  9: /home/admin/python3.6/lib/python3.6/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
 10:   .format(x=modname), ExtDeprecationWarning
 11: [2017-06-30 19:06:16,351] [24041] {models.py:167} INFO - Filling up the DagBag from /home/admin/airflow/dags
 12: Running the Gunicorn Server with:
 13: Workers: 4 sync
 14: Host: 0.0.0.0:8080
 15: Timeout: 120
 16: Logfiles: - -
 17: =================================================================            
 18: ----------------------------------------------------------------------------------------------------
 19: ['gunicorn', '-w', '4', '-k', 'sync', '-t', '120', '-b', '0.0.0.0:8080', '-n', 'airflow-webserver', '-p', '/home/admin/airflow/airflow-webserver.pid', '-c', 'airflow.www.gunicorn_config', '--access-logfile', '-', '--error-logfile', '-', 'airflow.www.app:cached_app()']
 20: ----------------------------------------------------------------------------------------------------
 21: Traceback (most recent call last):
 22:   File "/bin/airflow", line 28, in <module>
 23:     args.func(args)
 24:   File "/home/admin/python3.6/lib/python3.6/site-packages/airflow/bin/cli.py", line 794, in webserver
 25:     gunicorn_master_proc = subprocess.Popen(run_args)
 26:   File "/home/admin/python3.6/lib/python3.6/subprocess.py", line 707, in __init__
 27:     restore_signals, start_new_session)
 28:   File "/home/admin/python3.6/lib/python3.6/subprocess.py", line 1326, in _execute_child
 29:     raise child_exception_type(errno_num, err_msg)
 30: FileNotFoundError: [Errno 2] No such file or directory: 'gunicorn'
 31: 

airflow webserver啟動時,會調用subprocess.Popen創建子進程,webserver使用gunicorn,啟動參數:

  1: ['gunicorn', '-w', '4', '-k', 'sync', '-t', '120', '-b', '0.0.0.0:8080', '-n', 'airflow-webserver', '-p', '/home/admin/airflow/airflow-webserver.pid', '-c', 'airflow.www.gunicorn_config', '--access-logfile', '-', '--error-logfile', '-', 'airflow.www.app:cached_app()']

執行gunicorn啟動時,因為在PATH中找不到該命令報錯。

創建gunicorn軟連接

ln –fs /home/admin/python3.6/bin/gunicorn/bin/gunicorn /bin/gunicorn

或者將/home/admin/pytthon3.6/bin添加到PATH,export PATH=${PATH}:/home/admin/python3.6/bin


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM