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

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

  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,啓動參數:python

  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中找不到該命令報錯。web

建立gunicorn軟鏈接flask

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

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

相關文章
相關標籤/搜索