supervisor管理服务器进程

在服务器上同时管理多个java进程和python进程,我使用supervisor。
在/etc/supervisor/conf.d/路径下创建xxx.conf
在xxx.conf下配置如下

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
[program:gzh]
command=/root/python-gzh/venv/bin/gunicorn main:application -c /root/python-gzh/gunicorn.conf
directory=/root/python-gzh
user=root
autostart=true
autorestart=true
stdout_logfile=/root/python-gzh/logs/gzh.log

[program:provider]
command=java -jar /root/springboot/platform-system-provider.jar --spring.profiles.active=prod
directory=/root/springboot
user=root
autostart=true
autorestart=true
stdout_logfile=/root/springboot/logs/provider.log

[program:webapi]
command=java -jar /root/springboot/platform-mobile-client.jar --spring.profiles.active=prod
directory=/root/springboot
user=root
autostart=true
autorestart=true
stdout_logfile=/root/springboot/logs/webapi.log

[program:web]
command=java -jar /root/springboot/platform-admin-web.jar --spring.profiles.active=prod
directory=/root/springboot
user=root
autostart=true
autorestart=true
stdout_logfile=/root/springboot/logs/web.log

通过supervisorctl可以监控管理各种进程的状态了。

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2015-2021 小白兔
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信