欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

centos7使用supervisor的詳細(xì)教程

 更新時(shí)間:2020年08月20日 14:43:55   作者:sellsa  
這篇文章主要為大家介紹了centos7使用supervisor的詳細(xì)教程,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

supervisor是用Python開(kāi)發(fā)的一套通用的進(jìn)程管理程序,可以將一個(gè)普通的命令行進(jìn)程變?yōu)楹笈_(tái)daemon,并監(jiān)控進(jìn)程狀態(tài),異常退出時(shí)可以自動(dòng)重啟

安裝supervisor

# yum search setuptools
....
python-setuptools.noarch : Easily build and distribute Python packages
 
#yum install -y python-setuptools.noarch
 
#easy_install supervisor

創(chuàng)建主配置文件

# mkdir -m 755 -p /etc/supervisor   

\\創(chuàng)建supervisor配置文件目錄
# echo_supervisord_conf >/etc/supervisor/supervisord.conf 

\\創(chuàng)建主配置文件
# cd /etc/supervisor/
# mkdir -m 755 conf.d    

\\創(chuàng)建項(xiàng)目配置文件目錄

創(chuàng)建項(xiàng)目配置文件(運(yùn)行3個(gè)腳本)

# vim conf.d/test.ini
[program:tjapp_sendmessage]
command=/bin/bash /data/shell/sendmessage.sh
numprocs=1
autostart=true
autorestart=true
 
[program:bbscollection]
command=/bin/bash /data/shell/bbscollection.sh
numprocs=1
autostart=true
autorestart=true
 
[program:test_sbbscollection]
command=/bin/bash /data/shell/test_sbbscollection.sh
numprocs=1
autostart=true
autorestart=true

在主配置文件中引入test.ini

#cat supervisord.conf
...
[include]
files = ./conf.d/*.ini

啟動(dòng)supervisor

# supervisord -c /etc/supervisord.conf

查看supervisor運(yùn)行的腳本

# supervisorctl
bbscollection     RUNNING pid 10090, uptime 4 days, 17:20:10
test_sbbscollection    RUNNING pid 10088, uptime 4 days, 17:20:10
tjapp_sendmessage    RUNNING pid 10089, uptime 4 days, 17:20:10

停止bbscollection腳本

# supervisorctl stop bbscollection
bbscollection: stopped
[root@om-web_test supervisord.d]# supervisorctl
bbscollection   STOPPED Apr 06 10:23 AM
test_sbbscollection  RUNNING pid 10088, uptime 4 days, 17:23:13
tjapp_sendmessage  RUNNING pid 10089, uptime 4 days, 17:23:13
 
supervisor> start bbscollection \\啟動(dòng)
 
supervisor> status
bbscollection   RUNNING pid 7310, uptime 0:00:24
test_sbbscollection  RUNNING pid 10088, uptime 4 days, 17:23:54
tjapp_sendmessage  RUNNING pid 10089, uptime 4 days, 17:23:54

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論