zoukankan      html  css  js  c++  java
  • [Supervisor]supervisor监管gunicorn启动DjangoWeb时异常退出

    一开始配置

    [program:django_web]
    command=gunicorn  -w 4 -b 0.0.0.0:8080 superadmin.wsgi:application
    directory=.
    process_name=%(program_name)s ; process_name expr (default %(program_name)s)
    numprocs=1                    ; number of processes copies to start (def 1)
    stopsignal=QUIT               ; signal used to kill process (default TERM)
    redirect_stderr=true          ; redirect proc stderr to stdout (default false)
    stdout_logfile=/tmp/supervisor_superadmin.log
    stopasgroup=true
    autostart=false
    autorestart=false

    单独执行  gunicorn -w 4 -b 0.0.0.0:8080 superadmin.wsgi:application 没有问题,

    但是使用supervisor监控总是出现exited,查看日志:

    43 2018-09-17 16:41:42,009 INFO success: django_web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    44 2018-09-17 16:41:42,143 INFO exited: django_web (exit status 1; not expected)

    说明已经启动,然后竟然自动退出了。- -!

    刚开始一直以为是路径问题,改用绝对路径发现报相同的错。

    查看该program的日志 stdout_logfile=/tmp/supervisor_superadmin.log:

    File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
        raise HaltServer(reason, self.WORKER_BOOT_ERROR)
    gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

    继续查!

    这个错误的原因就是命令写法错误,或者是配置文件的错误

    正确的写法:

    gunicorn wsgi:application -b 0.0.0.0:8080 -w 4

    这样就可以启动了。

    完。

    我在这卡了半天啊喂,摔~!

  • 相关阅读:
    Python嵌入C/C++ (Python核心编程)
    c++ 降低文件间类的耦合度及关联度
    Python嵌入C++
    Windows编程学习笔记(十一)
    C++STL算法分析之:非变易算法
    背包九讲
    随机数 srand() & rand()
    C++ explicit 关键字解析
    [抄书]贪心策略的理论基础——拟阵
    WP7之LongListSelector控件
  • 原文地址:https://www.cnblogs.com/halleluyah/p/9667996.html
Copyright © 2011-2022 走看看