go版本的supervisord
2021年11月14日 13:27
描述
python版本的supervisrod, 在linux、windows系统中离线安装都不怎么方便. 是否有go版本的呢?
github地址
[https://github.com/ochinchina/supervisord/](https://github.com/ochinchina/supervisord/)
踩坑记录
* 编译32版本, 有些报错, 需要修改源码
* 在ui界面快速点击start/stop, 进程可能会启动多个。需要加锁处理处理.
## 用法
* 配置文件查找顺序
1 2 3 4 5 6 | $CWD/supervisord.conf$CWD/etc/supervisord.conf/etc/supervisord.conf/etc/supervisor/supervisord.conf (since Supervisor 3.3.0)../etc/supervisord.conf (Relative to the executable)../supervisord.conf (Relative to the executable) |
* 最简单配置supervisord.conf
1 2 | [program:test]command = /your/program args |
* 常用配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | [inet_http_server] ;http接口port=:9002;username=xxxx;password=xxxx[supervisorctl] ;ui界面serverurl=http://127.0.0.1:9002[supervisord] ;日志logfile=%(here)s/../log/supervisord.loglogfileMaxbytes=50MB ;文件大小logfileBackups=10 ;10个文件loglevel=info ;日志级别[program:middleware1] ;进程command = %(here)s/../middleware1.exe ;here指的是supervisord.conf的路径,而不是supervisord.exe的路径autorestart = truenumprocs=1 ;进程数量[program:programname1]command = %(here)s/../programname1.exeautorestart = truenumprocs=1depends_on=middleware1 ;依赖进程[program:programname2]command = %(here)s/../programname2.exeautorestart = truenumprocs=1depends_on=middleware1 |