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

    这样就可以启动了。

    完。

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

  • 相关阅读:
    show-meeting-subject-in-meeting-room-calendar
    前端模块化——彻底搞懂AMD、CMD、ESM和CommonJS
    微软到底有多恐怖?
    Office365云流程与开发授权错误
    JQuery实现省市联动 address-picker
    我的新作品 《平虏灭寇英杰传》
    ZT:C/C++ 字符串与数字相互转换
    C016:字符串倒置
    C015:十进制转8进制
    C014:不用算术分割显示逆序三位数
  • 原文地址:https://www.cnblogs.com/halleluyah/p/9667996.html
Copyright © 2011-2022 走看看