当前位置:网站首页>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]:~#
边栏推荐
- Openharmony South learning notes - hi3861+hc-sr04 ultrasonic testing
- 【无标题】测试【无标题】测试
- Typora图床配置详细教程
- C语言入门实战(11):输入一组正整数,求逆序数的和
- [paper notes] mobile robot navigation method based on hierarchical depth reinforcement learning
- Use of KOA framework
- LZ77 file compression
- The win11 installation system prompts that VirtualBox is incompatible and needs to uninstall the solution of virtual, but the uninstall list cannot find the solution of virtual
- 真人踩过的坑,告诉你避免自动化测试常犯的10个错误
- Looking for peak [Abstract dichotomy exercise]
猜你喜欢

云呐|公司固定资产如何管理?公司固定资产如何管理比较好?

Canvas from getting started to persuading friends to give up (graphic version)

MySQL unique index has no duplicate value, and the error is repeated

mysql 之general_log日志

Openharmony South learning notes - hi3861+hc-sr04 ultrasonic testing

mysql唯一索引无重复值报错重复
![[record of question brushing] 19. Delete the penultimate node of the linked list](/img/be/7e81e9376cb04566d669db4c606309.png)
[record of question brushing] 19. Delete the penultimate node of the linked list

Uni app knowledge points and records of problems and solutions encountered in the project

【小程序自动化Minium】一、框架介绍和环境搭建

@FeignClient使用详细教程(图解)
随机推荐
[pyqt5 installation and use]
Introduction and mechanism of Aptos
【软件测试】盘一盘工作中遇到的 MQ 异常测试
CAN总线快速了解
Argocd user management, RBAC control, script login, APP synchronization
Official wechat product! Applet automation framework minium sharing Preview
mysql 之general_log日志
Question 142 of Li Kou: circular linked list 2
104 maximum depth of binary tree and 543 diameter of binary tree and 124 maximum path sum of binary tree
【 langage c】 devinez jeux numériques + applet d'arrêt
Using JS to parse and execute XSS automatically
cmake笔记
【测试平台开发】二十、完成编辑页发送接口请求功能
基本51单片机点阵汉字显示程序设计
Advanced operation and maintenance 02
Is online handling of fund account opening safe? Who can answer it
PKI体系快速介绍
中望CAD专业版 2022软件安装包下载及安装教程
After using vscode to format the code, save and find that the code is messy again. What should I do? Vs remove formatting
Is it risky and safe to open an account for stock speculation?