服務(wù)器
supervisor是用Python開(kāi)發(fā)的一套通用的進(jìn)程管理程序,可以將一個(gè)普通的命令行進(jìn)程變?yōu)楹笈_daemon,并監控進(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 )建項目配置文件目錄
創(chuàng )建項目配置文件(運行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運行的腳本
# 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ì)热?,希望對大家的學(xué)習有所幫助,也希望大家多多支持特網(wǎng)科技。
更多關(guān)于云服務(wù)器,域名注冊,虛擬主機的問(wèn)題,請訪(fǎng)問(wèn)特網(wǎng)科技官網(wǎng):wap.friendlycc.com.cn
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站