zoukankan      html  css  js  c++  java
  • 后台进程管理supervisor

    一.安装supervisor
    该工具是python的一个软件包,需要安装python
    安装python-setuptools,然后通过
    ./easy_install supervisor

     安装,也可以通过pip install supervisor来安装

    也可以通过其他方式安装

     
    二.安装完后会在python的bin目录下找到对应的命令文件
     
    三.安装supervisor为服务
    1.打开https://github.com/Supervisor/initscripts
    2.找到redhat-init-mingalevme,下载,更改文件名为supervisord,放入/etc/init.d目录下,需要修改里面的执行路径,赋予执行权限
     
     
    四.配置
    1.echo_supervisord_conf > /etc/supervisor/supervisord.conf
     
    2.修改/etc/supervisor/supervisord.conf,默认是放在tmp文件夹内
     
    [unix_http_server]
    file=/var/run/supervisor.sock   ; (the path to the socket file)
     
     
    [supervisord]
    logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
     
    [supervisorctl]
    serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket
     
    [include]
    files = conf.d/*.conf
     
     
    五.配置程序
    1.在/etc/supervisor/新建conf.d文件夹
    2.在conf.d中新建,beanstalkd.conf
     
    [program:beanstalkd]
    command = /usr/local/bin/beanstalkd -l 127.0.0.1 -p 11300 -z 65535 -b /var/lib/beanstalkd -F
     
     
    六.启动
    service supervisord restart
     
    七.管理
    1.管理主要靠supervisorctl来管理

     
    #查看状态
    supervisorctl staus

    2.命令
    进入supervisorctl的命令行模式下
     
    # 停止某一个进程,program_name 为 [program:x] 里的 x
    supervisorctl stop program_name
    # 启动某个进程
    supervisorctl start program_name
    # 重启某个进程
    supervisorctl restart program_name
    # 结束所有属于名为 groupworker 这个分组的进程 (start,restart 同理)
    supervisorctl stop groupworker:
    # 结束 groupworker:name1 这个进程 (start,restart 同理)
    supervisorctl stop groupworker:name1
    # 停止全部进程,注:start、restart、stop 都不会载入最新的配置文件
    supervisorctl stop all
    # 载入最新的配置文件,停止原有进程并按新的配置启动、管理所有进程
    supervisorctl reload
    # 根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启
    supervisorctl update
  • 相关阅读:
    js阶段循环(for,while,do-while,for-in),判断(if,switch),练习题
    翻牌器
    用 VSCode 调试网页的 JS 代码
    图形化设置数据库规则
    js中ES6数据结构Map 、Set 、WeakMap 、 WeakSet
    css的filter方法,给图片添加滤镜
    使用<a-select>时,placeholder不起作用,提示语不显示
    Vue数据更新但页面没有更新的多种情况
    react事件处理-函数绑定
    在css中使用js定义的变量
  • 原文地址:https://www.cnblogs.com/itfenqing/p/6189513.html
Copyright © 2011-2022 走看看