软硬件环境

  • centos7.6.1810 64bit
  cat /etc/redhat-release #检查体系版别
  • supervisor 3.4.0

  • python 2.7.5

supervisor 简介

supervispython装置教程or是一个用python言语编写的进程处理东西HTTP,它能够很便利的监听、建议、连续、重启一个或多python培训班膏火一般多少个进程。当一个进程意外被杀死,superv监控摄像头品牌排行isor监听到进程身后,能够很便利的让进程自动康复,不再需求程序员或体系处理员自己编写代码来控制。

supervisord 设备

yum install -y epel-release监控摄像头怎样衔接手机
yum install -y supervisor

建议&打开自启

systemctl start supervisord
systemctl enable supervisord

其他指令

systemctl stop supervisord
systemctl start supervisord
systemctpython怎样读l status supervisord
syhttp://www.baidu.comstemctl reload supervisord
systemctl restart supervisord

supervisor 的 web 端

supervisor供给了python培训班膏火一般多少根据wpython123eb的控制,处理员能够通过在页面上点点按钮即可完成对进程的建议、重启等操作,甚是便利。

进入装备文件,打开对 web 端的支撑

vim /et监控摄像头c/supervisord.conf

假如供给给外部访问,需求将 port 改为本机 ip 地址

#撤消10-13行注释,前面数字是行号
[inet_http_server]         ; inet (TCP) servehttp://192.168.1.1登录r di前端开发是干什么的sabled by default
port=192.168.26.121:9001   ; (ip_address:port specifier, *:port for all iface)
u监控怎样衔接手机sername=user              ; (default is no usehttp 404rname (open server))
password=123               ; (default is no password (open server))

装备完前端开发需求学什么成后重启服务

systemctl restart supervisord

supervisord 运用装备

进入 supervisord 装备文件

cat /etc/supervisord.conf

通过装备文件最终一行看到

[include]
files = supervisord.d/*.ini

也便是程序员培训班要多少钱说,咱们悉数的运用装备文件都保存在这个目录下,以**.ini**格局命名保前端和后端的差异存的,能够自行修正地址,但不要修正后缀

那咱们来创立一个受监控的运用python123

创立测验 python 装备

创立前端学什么一个称谓叫做python程序员需求什么学历的运用程序装备

vim /etc/supervisord.d/python.ini

装备文件内容,其间 command 便是我程序员怎样学们运用前端学什么程序建议需求履行的指令

[program:pythpython是什么意思on] #这儿的python程序员便是咱们显现在web前端以及终端的监控称谓
cohttp 500mmand=python /tmp/supervisordtest/test.py  #咱们要监控的文件地址
autostart=true
autorestart=true
startsecs=1
startretries=3
redirect_stderr=true
stdout_logfile=/tmp/supervisor监控怎样衔接手机dtest/access_pyhttp署理thon.log   #日志地址,可自行装备目录
stderr_logfile=/tmp/supervisordtest/error_python.log    #日志地址,可自行装备目录

创立 test.py

mkdir /tmp/supervisordtest
vim /tmp/supervisordtest/test.py

程序内容:程序员是做什么的打开一个死循环,不停的打印内容

while True:
p前端面试题2021rint(100)

重启 supervisord 使装备文件生效

systemctl restart supervisord

检查运用是否正常发http协议

1、指令检查

systemc监控录像能保存多久tl status supervisord

2、可视化 web 检查

web 端能够重启,连续,整理日志,检查日志等多个操作

3分钟学会怎样上手supervisor看门狗

supervisor 相关的几个指令

设备完毕,会生成 3 个体系指令supython123pervisorctlpython123supervisordechpython下载o_supervisord_conf

  1. supervisord,工作superv程序员培训班要多少钱isor时会建议一个进程supervisord,它担任建议所处理的进程,并前端开发是干什么的将所处理的进程作为自己的子进程来建议,而且能够httpclient在所处理的进程呈现溃散时自动重启

  2. supervisorctl 是指令行处理东西,能够用来履行 start stop restart 等指令,来对这前端开发是干什么的些子进程进行处理, 如

    sudo supervisorctl start demoweb
    

    其间 demoweb 是进程的称谓, 详细的指令及说明见下面的这张表

    指令 说明
    sup前端和后端的差异ervisorctl starthttps和http的差异 programhttps和http的差异_name 建议某个进程
    supervishttps和http的差异orctl stop program_name 连续某个进程
    supervisorct程序员培训班要多少钱l re监控怎样衔接手机start program_name 重启某个进程
    supervisorctl status program_namepython下载 检查某个进程的状况python怎样读
    supervisorctl stop all 连续悉数进程 |
    supervisorctl reload 载入最新的装备文件,重启悉数进程
    supervisorctl update 依据最新的装备,重启装备更改过的进程,未更新的进程不受影响
  3. echo_supervisord_conf

    用来程序员薪酬一般多少生成默许的装备文件(默许装备文件,内容非常彻底且都有注释,合适用时查阅,用法是这程序员培训班要多少钱样的

echo_supervisord_conf &gthttp://www.baidu.com; test.conf