centos安装与配置supervisor

  1. 安装supervisor
yum install -y supervisor
  1. 安装完成后启动服务
systemctl start supervisord

3.查看服务状态

systemctl status supervisord

在这里插入图片描述
4. 查看配置文件,新增自己的进程监听配置文件目录

vi /etc/supervisord.conf

在这里插入图片描述
5.进入刚才的目录,新增自己的配置

cd /etc/supervisord.d

6.配置参考

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /www/yourapp/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile=/www/wwwlogs/supervisor.log 

7.重启服务

systemctl restart supervisord

8.查看服务状态

systemctl status supervisord

在这里插入图片描述
9.设置服务开启自启动

systemctl enable supervisord

supervisor常用命令

systemctl stop supervisord    停止服务
systemctl start supervisord   开启服务
systemctl status supervisord  查看状态
systemctl reload supervisord  重载配置
systemctl restart supervisord 重启
ps -ef|grep supervisord 查看是否启动成功
netstat -tunlp|grep 端口号   查看端口号
systemctl enable supervisord 设置开机自启
supervisorctl reload 重载
supervisorctl status:查看所有进程的状态
supervisorctl stop demo:停止demo
supervisorctl start demo:启动demo
supervisorctl restart demo: 重启demo
supervisorctl update :配置文件修改后可以使用该命令加载新的配置
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值