Supervisor 使用注意事项

2020-09-24  本文已影响0人  forks1990

Overview

supervisor c/s 结构,daemon 程序 supervisord,客户端程序supervisorctl。所在的发行版应该已经配置好systemctlsystemctl start supervisord 启动。

配置daemon,打开配置文件 /etc/supervisord.conf,注意include部分:

; 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 = supervisord.d/*.ini

个人喜欢include文件的方式,一个服务一个文件,也利于docker,ansible,vagrant等工具。

配置

配置参考官方文档或者教程,不在这里copy了。

客户端工具的使用

supervisorctl 可以作为命令,也可以作为shell使用。

命令方式,可以使用supervisorctl help 获得命令列表。supervisorctl -help 获得基本的帮助信息。

命令方式不大好用,因为shell方式可以自动完成。

supervisorctl

启动shell。命令和命令行方式一致。

总结

supervisor 比 systemctl 配置简单,supervisorctl也容易使用。supervisor 用来启动app级别的服务更方便。

上一篇下一篇

猜你喜欢

热点阅读