supervisor使用手册

一、简介


Supervisor是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统。它可以很方便的监听、启动、停止、重启一个或多个进程。用Supervisor管理的进程,当一个进程意外被杀死,supervisort监听到进程死后,会自动将它重新拉起,很方便的做到进程自动恢复的功能,不再需要自己写shell脚本来控制。

二、命令


2.1 命令行模式

supervisorctl status #查看当前所有守护的程序
supervisorctl start <program_name> #启动一个程序
supervisorctl stop <program_name> #关闭一个程序
supervisorctl restart <program_name> #重启一个程序
supervisorctl start all #启动所有程序
supervisorctl stop all #关闭所有程序

2.2 客户端模式

输入`supervisorctl`进入客户端模式

supervisor> status #查看当前所有守护的程序
supervisor> start <program_name> #启动一个程序
supervisor> stop <program_name> #关闭一个程序
supervisor> restart <program_name> #重启一个程序
supervisor> start all #启动所有程序
supervisor> stop all #关闭所有程序

三、日志


所有程序的日志根据配置文件设置,均放在/log/目录中,以xxx.out.log保存。

root@yidong:~# cd /log/
root@yidong:/log# ll
总用量 148816
-rw-r--r-- 1 root root 6121921 10月 27 20:29 config.out.log
-rw-r--r-- 1 root root 10634 10月 27 20:28 eureka.out.log
-rw-r--r-- 1 root root 733981 10月 27 20:33 frp.out.log
-rw-r--r-- 1 root root 54754 10月 27 20:33 logstash-img2.out.log
-rw-r--r-- 1 root root 54049 10月 27 20:33 logstash.out.log
-rw-r--r-- 1 root root 0 10月 25 19:54 mongod.out.log
-rw-r--r-- 1 root root 2464284 10月 27 20:30 ms.out.log
-rw-r--r-- 1 root root 58535 10月 27 20:28 netty.out.log
-rw-r--r-- 1 root root 34935902 10月 27 20:33 oauth2.out.log
-rw-r--r-- 1 root root 52428965 10月 27 05:59 oauth2.out.log.1
-rw-r--r-- 1 root root 52428994 10月 26 10:15 oauth2.out.log.2
-rw-r--r-- 1 root root 150696 10月 27 20:28 tomcat.out.log
-rw-r--r-- 1 root root 2860514 10月 27 20:30 ws.out.log
技术微信群:
加微信:wonter 发送:技术Q
医疗微信群:
加微信:wonter 发送:医疗Q
更多文章关注公众号:

原文地址:https://www.cnblogs.com/Javame/p/14576697.html