Supervisor monitoring application springboot

1 supervisor introduces
supervisor python is a process management system, the process can easily monitor, manage linux operating system service official website address

supervisor include supervisord and supervisorctl
supervisord is the server supervisor, which is responsible for calling the self-start routines, respond to commands from the client, restart the crash or the child process exits, recording its child processes stdout and stderr output and generate and dealing with child the lifetime of the process corresponding to the point "event."
supervisorctl is the supervisor of the command-line client (command-line client), provides a similar shell commands interactive features. supervisorctl communicate using UNIX domain sockets, or Internet (TCP) socket with the server supervisord

Installation and Configuration 2 supervisor
centos supervisor system installation process is as follows:

yum -y install supervisor

After completing the installation boundary supervisord.conf profile

 vi /etc/supervisord.conf

The last to join in supervisord.conf

[program:appname]  #appname是自己应用的名称
directory = /opt/apps # 程序的启动目录
command = java -jar /opt/apps/springboot-test.jar # 执行启动命令
autostart = true     # 当 supervisord 自动启动时应用也一起启动
startsecs = 30        #启动 30 秒后没有异常退出
autorestart = true   # 程序异常退出后自动重启
startretries = 3     # 启动失败自动重试次数,默认是 3
user = root          # 启动用户
redirect_stderr = true  # 把 stderr 重定向到 stdout,默认 false
stdout_logfile_maxbytes = 50MB  # stdout 日志文件大小
stdout_logfile_backups = 10     # stdout 日志文件备份数
# stdout 日志文件,需要注意当指定目录不存在时无法正常启动,所以需要手动创建目录(supervisord 会自动创建日志文件)
stdout_logfile = /var/log/springboot-test.log #应用日志目录

4 the supervisor to take effect

supervisorctl reload
Published 10 original articles · won praise 0 · Views 141

Guess you like

Origin blog.csdn.net/holmes369/article/details/104656107