zoukankan      html  css  js  c++  java
  • supervisor使用,需要注意python3 pip

    在linux里用pip install supervisor,配置文件都在**/usr/local/python3/bin**里,安装时会有黄色字提醒的:

    WARNING: The scripts echo_supervisord_conf, pidproxy, supervisorctl and supervisord are installed in '/usr/local/python3/bin' which is not on PATH.
    Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    1
    2
    所以当我们在自己项目里用vim配置好自己写的supervisor.conf 时,执行
    supervisord -c supervisor.conf 时,会报错:无法找到supervisord这个包。

    解决办法:
    cd /usr/local/python3/bin,里面有echo_supervisord_conf, pidproxy, supervisorctl and supervisord 。
    我们只要

    cp supervisord /usr/bin/
    1
    把supervisord复制到/usr/bin/目录下即可

    再次执行,亲测可以成功。

    /etc/supervisord.conf内容:

    [supervisord]
    logfile = /tmp/supervisord.log
    logfile_maxbytes = 50MB
    logfile_backups=10
    loglevel = info
    pidfile = /tmp/supervisord.pid
    nodaemon = false
    minfds = 1024
    minprocs = 200
    umask = 022
    identifier = supervisor
    directory = /tmp
    nocleanup = true
    childlogdir = /tmp
    strip_ansi = false
    
    [supervisorctl]
    serverurl = unix:///tmp/supervisor.sock
    prompt = mysupervisor
    
    
    [program:MyFlask]
    
    # 启动命令入口
    command=/usr/bin/uwsgi /opt/onlinewww/MyFlask/uwsgi.ini
    directory=/opt/onlinewww/MyFlask
    #运行命令的用户名
    user=root
    autostart=true #跟随Supervisor一起启动
    autorestart=true # 挂掉之后自动重启
    #日志地址
    #stdout_logfile=/var/www/app/logs/uwsgi_supervisor.log

    启动:supervisord -c /etc/supervisord.conf

  • 相关阅读:
    [转载]C#.NET中Dns类的常用方法及说明
    [转载]如何辨别真假百度蜘蛛
    Lottie的json动画
    iOT
    iOS字体大小
    针对Xcode 9 + iOS11 的修改,及iPhone X的适配
    shell脚本之 给PNG图片添加后缀@3x
    正则表达式
    CSS
    XcodeProj,使用Ruby更改工程文件
  • 原文地址:https://www.cnblogs.com/anthony-wang0228/p/12687815.html
Copyright © 2011-2022 走看看