<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 1.**安裝** #### *方式1 先安裝 Python 的`easy_install`,再通過 easy\_install 安裝 supervisor ``` yum install python-setuptools easy_install supervisor ``` #### *方式2 ``` yum install Supervisor ``` #### **2.啟動服務** ~~~ supervisord -c /etc/supervisord.conf ~~~ 進入 cd /etc 目錄 找到supervisord.conf 配置文件 和 supervisord.d 文件夾,使用vim編輯supervisord.conf文件,拉到最底部我們可以看到 ![](images/screenshot_1629189641268.png) files = supervisord.d/\*.ini?這句代碼說明它會加載supervisord.d文件夾中的所有.ini配置文件 * 我們可以 創建一個文件夾 專門管理第三步的編輯 也可以選擇默認 #### **3.編輯配置文件** 隨后我們在`supervosprd.d`中創建一個`blog-work.ini`文件并編輯如下 ~~~ [program:blog-work] process_name=%(program_name)s_%(process_num)02d command=/usr/local/php/bin/php /www/blog/artisan queue:work database --sleep=3 --tries=3 --daemon autostart=true autorestart=true user=root numprocs=2 redirect_stderr=true stdout_logfile=/www/blog/storage/logs/queue.log ~~~ #### **4.重載配置文件** 執行命令使用心得配置文件運行supervisor服務 ~~~ supervisorctl reload //重新加載配置文件 ~~~ * 自動啟動 1 `systemctl enable supervisord` * 自動啟動2 在 https://github.com/Supervisor/initscripts 下載 CentOS 使用的自動啟動服務腳本 centos-systemd-etcs `wget -O /usr/lib/systemd/system/supervisord.service https://github.com/Supervisor/initscripts/raw/master/centos-systemd-etcs` * 將 supervisord 服務設為自啟動 `systemctl enable supervisord.service` #### **5.設置laravel隊列** ~~~ [program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=/usr/local/php/bin/php /data/wwwroot/app.com/artisan queue:work database --sleep=3 --tries=3 --daemon autostart=true autorestart=true user=www numprocs=8 redirect_stderr=true stdout_logfile=/data/wwwroot/app.com/storage/logs/queue.log ~~~ 如果以后配置文件有修改,或者新增,進入 supervisor 控制臺,執行下面的命令 ~~~ # supervisorctl supervisorctl> reread supervisorctl> update supervisorctl> start laravel-worker:* ~~~ ### **supervisord.conf 配置文件說明** ~~~ [unix_http_server] file=/tmp/supervisor.sock ;UNIX socket 文件,supervisorctl 會使用 ;chmod=0700 ;socket文件的mode,默認是0700 ;chown=nobody:nogroup ;socket文件的owner,格式:uid:gid ;[inet_http_server] ;HTTP服務器,提供web管理界面 ;port=127.0.0.1:9001 ;Web管理后臺運行的IP和端口,如果開放到公網,需要注意安全性 ;username=user ;登錄管理后臺的用戶名 ;password=123 ;登錄管理后臺的密碼 [supervisord] logfile=/tmp/supervisord.log ;日志文件,默認是 $CWD/supervisord.log logfile_maxbytes=50MB ;日志文件大小,超出會rotate,默認 50MB,如果設成0,表示不限制大小 logfile_backups=10 ;日志文件保留備份數量默認10,設為0表示不備份 loglevel=info ;日志級別,默認info,其它: debug,warn,trace pidfile=/tmp/supervisord.pid ;pid 文件 nodaemon=false ;是否在前臺啟動,默認是false,即以 daemon 的方式啟動 minfds=1024 ;可以打開的文件描述符的最小值,默認 1024 minprocs=200 ;可以打開的進程數的最小值,默認 200 [supervisorctl] serverurl=unix:///tmp/supervisor.sock ;通過UNIX socket連接supervisord,路徑與unix_http_server部分的file一致 ;serverurl=http://127.0.0.1:9001 ; 通過HTTP的方式連接supervisord ; [program:xx]是被管理的進程配置參數,xx是進程的名稱 [program:xx] command=/opt/apache-tomcat-8.0.35/bin/catalina.sh run ; 程序啟動命令 autostart=true ; 在supervisord啟動的時候也自動啟動 startsecs=10 ; 啟動10秒后沒有異常退出,就表示進程正常啟動了,默認為1秒 autorestart=true ; 程序退出后自動重啟,可選值:[unexpected,true,false],默認為unexpected,表示進程意外殺死后才重啟 startretries=3 ; 啟動失敗自動重試次數,默認是3 user=tomcat ; 用哪個用戶啟動進程,默認是root priority=999 ; 進程啟動優先級,默認999,值小的優先啟動 redirect_stderr=true ; 把stderr重定向到stdout,默認false stdout_logfile_maxbytes=20MB ; stdout 日志文件大小,默認50MB stdout_logfile_backups = 20 ; stdout 日志文件備份數,默認是10 ; stdout 日志文件,需要注意當指定目錄不存在時無法正常啟動,所以需要手動創建目錄(supervisord 會自動創建日志文件) stdout_logfile=/opt/apache-tomcat-8.0.35/logs/catalina.out stopasgroup=false ;默認為false,進程被殺死時,是否向這個進程組發送stop信號,包括子進程 killasgroup=false ;默認為false,向進程組發送kill信號,包括子進程 ;包含其它配置文件 [include] files = relative/directory/*.ini ;可以指定一個或多個以.ini結束的配置文件 files = /etc/supervisor/conf.d/*.ini ~~~ ## **laravel 隊列 各種配置參考** ~~~ [program:分期3線程] command=php artisan queue:listen --queue=line3 directory=/home/wwwroot/api-fq.fenqiqian.com.cn/ autorestart=true startsecs=3 startretries=3 stdout_logfile=/www/server/panel/plugin/supervisor/log/分期3線程.out.log stderr_logfile=/www/server/panel/plugin/supervisor/log/分期3線程.err.log stdout_logfile_maxbytes=2MB stderr_logfile_maxbytes=2MB user=www priority=999 numprocs=3 process_name=%(program_name)s_%(process_num)02d [program:分期隊列] command=php artisan queue:listen directory=/home/wwwroot/api-fq.fenqiqian.com.cn/ autorestart=true startsecs=3 startretries=3 stdout_logfile=/www/server/panel/plugin/supervisor/log/分期隊列.out.log stderr_logfile=/www/server/panel/plugin/supervisor/log/分期隊列.err.log stdout_logfile_maxbytes=2MB stderr_logfile_maxbytes=2MB user=www priority=999 numprocs=8 process_name=%(program_name)s_%(process_num)02d [program:noval-queue] command=php artisan queue:listen directory=/www/noval_admin autorestart=true startsecs=3 startretries=3 user=root priority=999 numprocs=8 process_name=%(program_name)s_%(process_num)02d stdout_logfile=/www/noval_admin/storage/logs/queue.success.log stderr_logfile=/www/noval_admin/storage/logs/queue.error.log stdout_logfile_maxbytes=2MB stderr_logfile_maxbytes=2MB [program:blog-work] process_name=%(program_name)s_%(process_num)02d command=/usr/local/php/bin/php /www/blog/artisan queue:work database --sleep=3 --tries=3 --daemon autostart=true autorestart=true user=root numprocs=2 redirect_stderr=true stdout_logfile=/www/blog/storage/logs/queue.log ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看