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

    这样就可以启动了。

    完。

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

  • 相关阅读:
    MySQL学习笔记(12):触发器
    MySQL学习笔记(11):存储过程和函数
    MySQL学习笔记(10):视图
    MySQL学习笔记(9):索引
    MySQL学习笔记(8):字符集
    MySQL学习笔记(7):存储引擎
    MySQL学习笔记(6):常用函数
    MySQL学习笔记(5):运算符
    MySQL学习笔记(4):数据类型
    MySQL学习笔记(3):SQL
  • 原文地址:https://www.cnblogs.com/halleluyah/p/9667996.html
Copyright © 2011-2022 走看看