In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
supervisor is a general process management program developed in Python, which can turn an ordinary command-line process into a background daemon and monitor the process status. It can automatically restart when exiting abnormally.
Install supervisor
# yum search setuptools.... python-setuptools.noarch : Easily build and distribute Python packages #yum install -y python-setuptools.noarch #easy_install supervisor
Creating a Master Profile
# mkdir -m 755 -p /etc/supervisor \\Create supervisor configuration file directory # echo_supervisor_conf >/etc/supervisor/supervisor.conf \\Create main configuration file # cd /etc/supervisor/# mkdir -m 755 conf.d \\Create project profile directory
Create project profile (run 3 scripts)
# vim conf.d/test.ini[program:tjapp_sendmessage]command=/bin/bash /data/shell/sendmessage.shnumprocs=1autostart=trueautorestart=true [program:bbscollection]command=/bin/bash /data/shell/bbscollection.shnumprocs=1autostart=trueautorestart=true [program:test_sbbscollection]command=/bin/bash /data/shell/test_sbbscollection.shnumprocs=1autostart=trueautorestart=true
Introduce test.ini in the main configuration file
#cat supervisord.conf... [include]files = ./ conf.d/*.ini
Start supervisor
# supervisord -c /etc/supervisord.conf
View scripts run by supervisor
# supervisorctlbbscollection RUNNING pid 10090, uptime 4 days, 17:20:10test_sbbscollection RUNNING pid 10088, uptime 4 days, 17:20:10tjapp_sendmessage RUNNING pid 10089, uptime 4 days, 17:20:10
Stop the bbcollection script
# supervisorctl stop bbscollectionbbscollection: stopped[root@om-web_test supervisord.d]# supervisorctlbbscollection STOPPED Apr 06 10:23 AMtest_sbbscollection RUNNING pid 10088, uptime 4 days, 17:23:13tjapp_sendmessage RUNNING pid 10089, uptime 4 days, 17:23:13 supervisor> start bbcollection\\Start supervisor> statusbbcollection RUNNING pid 7310, uptime 0:00:24test_sbbscollection RUNNING pid 10088, uptime 4 days, 17:23:54tjapp_sendmessage RUNNING pid 10089, uptime 4 days, 17:23:54
The above is all the content of this article, I hope to help everyone's study, but also hope that everyone a lot of support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.