zoukankan      html  css  js  c++  java
  • supervisord 进程管理器 执行队列

    Supervisor 是一个 Linux 下的进程管理器,它会在 queue:work 进程关闭后自动重启。 可代替crontab定时脚本

    参考: [supervisor 安装配置使用] https://learnku.com/laravel/t/2126/supervisor-installation-configuration-use
        [supervisor 从安装到使用] https://www.jianshu.com/p/3658c963d28b
        [laravel官文] https://learnku.com/docs/laravel/5.6/queues/1395#e45763
    1.安装[centOS]
      yum install supervisor
    2.修改配置文件 /etc/supervisord.conf 最后一行 ini改为conf
      vim /etc/supervisord.conf
      files=/etc/supervisor/*.conf
    3./etc/supervisord.d目录下新增配置文件
      vim jlt-worker.conf
        [program:jlt-worker]    ;*[program:应用名称]
        process_name=%(program_name)s_%(process_num)02d     ;当numprocs为1时,process_name=%(program_name)s; 当numprocs>=2时,%(program_name)s_%(process_num)02d
        command=php /data/httpd/jlt-staging/artisan queue:work --sleep=3 --tries=3    ;*命令路径
        autostart=true             ;如果是true,当supervisor启动时,程序将会自动启动
        autorestart=true          ;*自动重启
        ;user=user ;user 报错,暂时注释掉 应该是/etc/supervisord.conf需要配置账号密码 我没有设置
        numprocs=8               ;进程数量
        redirect_stderr=true     ;是否重定向
        stdout_logfile=/data/httpd/jlt-staging/storage/logs/worker.log    ;日志文件位置
    4.启动+重启 /etc目录下执行 无报错即运行成功
      supervisord -c /etc/supervisord.conf // 启动??
      ps aux | grep supervisord // 查看 supervisord是否运行
      ps -ef | grep supervisord // 查看是否启动
      sudo supervisorctl reload
      sudo supervisorctl update
      sudo supervisorctl start jlt-worker:*

  • 相关阅读:
    一维数组
    do while循环(熟悉)
    while循环的概念和使用
    break关键字
    continue关键字
    for循环的概念与使用
    switchcase分支结构
    if else if else分支结构
    关于scanf()读取与返回值和回车键的问题
    WCF通过IIS寄宿服务
  • 原文地址:https://www.cnblogs.com/mengwangchuan/p/10593104.html
Copyright © 2011-2022 走看看