当前位置:网站首页>supervisord安装使用
supervisord安装使用
2022-07-23 09:34:00 【lionwerson】
supervisord安装使用
supervisord简介:
supervisord是一个c/s模式的进程管理程序,它可以用来监控应用程序的进程,并且可以管理应用程序的start/stop/restart/reload等功能。
安装supervisord:
[email protected]:~# apt-get install supervisord -y #apt安装supervisord
[email protected]:~# supervisord -v #supervisord版本
3.3.1
supervisord配置文件:
supervisord配置文件默认路径:/etc/supervisor/supervisord.conf
[email protected]:~# vim /etc/supervisor/supervisord.conf
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf #进程监控配置路径
[inet_http_server] #web页面端口
port=*:9080 #web页面地址:9080或*:9080
username=admin #web页面的用户名和密码
password=admin
supervisord监控进程配置文件:
#配置监控的应用程序:
[email protected]:~# vim /etc/supervisor/conf.d/prometheus.conf
#用户程序为prometheus
[program:prometheus]
#启动命令,不能使用nohup等后台运行命令否则应用程序会无限重启
command=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml
autostart=true #自动启动
autorestart=true #自动重启
process_name=prometheus #进程名称
startretries=5 #尝试启动的次数
启动supervisord程序:
[email protected]:~# systemctl start supervisor.service #
打开http://IP:9080,输入用户名和密码就可以在web页面查看监控的应用程序:

supervisordctl命令行
| 命令 | 参数 | 作用 |
|---|---|---|
| supervisorctl | stop program:name | 停止配置文件中的某个应用程序 |
| supervisorctl | start program:name | 启动配置文件中的某个应用程序 |
| supervisorctl | restart program:name | 重启配置文件中的某个应用程序 |
| supervisorctl | stop all | 停止全部进程 |
| supervisorctl | relod | 载入新配置文件然后启动应用程序 |
| supervisorctl | update | 载入新配置文件启动,没有改变就不重启进程 |
| supervisorctl | tail program:name | 查看应用程序的日志 |
[email protected]:~# supervisorctl start prometheus
prometheus: started
[email protected]:~# supervisorctl stop prometheus
prometheus: stopped
[email protected]:~#
边栏推荐
- 一道代码题看 CommonJS 模块化规范
- 云呐|公司固定资产如何管理?公司固定资产如何管理比较好?
- Yunna | how to manage the fixed assets of the company? How to manage the company's fixed assets better?
- Looking for peak [Abstract dichotomy exercise]
- LeetCode-227-基本计算器||
- OpenCV计算外包矩形
- C# 线程锁和单多线程简单使用
- 利用js自动解析执行xss
- First acquaintance and search set
- Some libraries that can perform 2D or 3D triangulation
猜你喜欢
![[test platform development] 21. complete sending interface request and display response header information](/img/53/42411ceb6e0e304355ddc396ea2922.png)
[test platform development] 21. complete sending interface request and display response header information
![[test platform development] 23. interface assertion function - save interface assertion and edit echo](/img/36/aed4feb6a4e40b6b5c06206a8ed440.png)
[test platform development] 23. interface assertion function - save interface assertion and edit echo

Cmake notes

Official wechat product! Applet automation framework minium sharing Preview

云呐-如何加强固定资产管理?怎么加强固定资产管理?

Authing supports Zadig! Unified authentication and rapid docking of cloud native users

【测试平台开发】23. 接口断言功能-保存接口断言和编辑回显

FastAPI应用加入Nacos

直播课堂系统03补充-model类及实体

Using shell script to block IP with high scanning frequency
随机推荐
Regular expression common syntax parsing
【测试平台开发】十七、接口编辑页面实现下拉级联选择,绑定接口所属模块...
Openharmony South learning notes - hi3861+hc-sr04 ultrasonic testing
固定资产管理系统哪家好?固定资产管理平台有哪些?
The accuracy of digital addition
CSDN writing method (II)
直播课堂系统01-数据库表设计
Using JS to parse and execute XSS automatically
Official wechat product! Applet automation framework minium sharing Preview
PKI体系快速介绍
右键新建txt,新建文本文件不见了,通过添加注册表就可以解决,找来找去办法解决不了的终极办法
First acquaintance and search set
Authing 支持 Zadig 啦!云原生用户统一认证快速对接
C# 线程锁和单多线程简单使用
CSDN写文方法(二)
【小程序自动化Minium】三、元素定位- WXSS 选择器的使用
Generate order number
Transferred from Yuxi information disclosure: products such as mRNA covid-19 vaccine and Jiuzhou horse tetanus immunoglobulin are expected to be on the market within this year.
反射调用事务方法导致事务失效
Is online handling of fund account opening safe? Who can answer it