当前位置:网站首页>Supervisor monitors gearman tasks
Supervisor monitors gearman tasks
2022-07-03 17:48:00 【Brother Xing plays with the clouds】
install supervisor Method , It can be used directly yum install supervisord , But the version may be a little older , You can refer to the official method : easy_install supervisor
http://supervisord.org/installing.html#installing-to-a-system-with-internet-access
Join in service, vim /etc/init.d/supervisord , Modify the file attribute to executable chmod 777 /etc/init.d/supervisord
#!/bin/bash # # supervisord This scripts turns supervisord on # # Author: Mike McGrath <[email protected]> (based off yumupdatesd) # Jason Koppe <[email protected]> adjusted to read sysconfig, # use supervisord tools to start/stop, conditionally wait # for child processes to shutdown, and startup later # # chkconfig: 345 83 04 # # description: supervisor is a process control utility. It has a web based # xmlrpc interface as well as a few other nifty features. # processname: supervisord # config: /etc/supervisord.conf # pidfile: /var/run/supervisord.pid #
# source function library . /etc/rc.d/init.d/functions
# source system settings [ -e /etc/sysconfig/supervisord ] && . /etc/sysconfig/supervisord
RETVAL=0
start() { echo "Starting supervisord: " if [ -e $PIDFILE ]; then echo "ALREADY STARTED" return 1 fi
# start supervisord with options from sysconfig (stuff like -c) /usr/bin/supervisord $OPTIONS # show initial startup status /usr/bin/supervisorctl $OPTIONS status # only create the subsyslock if we created the PIDFILE [ -e $PIDFILE ] && touch /var/lock/subsys/supervisord }
stop() { echo -n "Stopping supervisord: " /usr/bin/supervisorctl $OPTIONS shutdown if [ -n "$WAIT_FOR_SUBPROCESSES" ]; then echo "Waiting roughly 60 seconds for $PIDFILE to be removed after child processes exit" for sleep in 2 2 2 2 4 4 4 4 8 8 8 8 last; do if [ ! -e $PIDFILE ] ; then echo "Supervisord exited as expected in under $total_sleep seconds" break else if [[ $sleep -eq "last" ]] ; then echo "Supervisord still working on shutting down. We've waited roughly 60 seconds, we'll let it do its thing from here" return 1 else sleep $sleep total_sleep=$(( $total_sleep + $sleep )) fi
fi done fi
# always remove the subsys. we might have waited a while, but just remove it at this point. rm -f /var/lock/subsys/supervisord }
restart() { stop start }
case "$1" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; restart|force-reload) restart RETVAL=$? ;; reload) /usr/bin/supervisorctl $OPTIONS reload RETVAL=$? ;; condrestart) [ -f /var/lock/subsys/supervisord ] && restart RETVAL=$? ;; status) /usr/bin/supervisorctl $OPTIONS status RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" exit 1 esac
exit $RETVAL
Configure it ,echo_supervisord_conf > /etc/supervisord.conf
Join in gearman The task of , The following is the task pushed by Baidu cloud
vim /etc/supervisord.conf
[program:APNS_PUSH] command=/usr/bin/php /data2/www/web/apns/worker_origin.php process_name=APNS_PUSH_%(process_num)s numprocs=2 autostart=true autorestart=true user=nginx stdout_logfile=/data2/log/push/push_%(process_num)s.log stderr_logfile=/data2/log/push/push.error.log
Let's start first gearman, start-up supervisord,ps -ef |grep xxx Check whether the task has been executed
in addition , You can also use gearman-monitor Check it out. gearman Task status
边栏推荐
- Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition
- 【JokerのZYNQ7020】DDS_ Compiler。
- 鸿蒙第四次培训
- c# . Net tool ecosystem
- Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
- supervisor监控Gearman任务
- Applet setting multi account debugging
- Kotlin's collaboration: Context
- [combinatorics] generating function (summation property)
- Remote office tools sharing | community essay solicitation
猜你喜欢

Leetcode Valentine's Day Special - looking for a single dog

Select 3 fcpx plug-ins. Come and see if you like them
![[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th](/img/f1/c96c4a6d34e1ae971f492f4aed5a93.jpg)
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th

Talk about the design and implementation logic of payment process

Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13

Vs2013 has blocked the installer, and ie10 needs to be installed

SQL injection database operation foundation

TCP congestion control details | 3 design space

POM in idea XML graying solution
![[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela](/img/df/a034032e203e7935dafaf8a71cb6c8.jpg)
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
随机推荐
ArrayList分析3 : 删除元素
[combinatorics] generating function (linear property | product property)
毕业总结
[vscode] convert tabs to spaces
Test your trained model
First day of rhcsa study
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th
UE4 official charging resources, with a total price of several thousand
AcWing 3438. Number system conversion
Kubernetes resource object introduction and common commands (III)
(9) Opencv Canny edge detection
Research on Swift
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
Mathematical formula (test)
[combinatorics] recursive equation (the non-homogeneous part is an exponential function and the bottom is the characteristic root | example of finding a special solution)
Remote office tools sharing | community essay solicitation
Kotlin的协程:上下文
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
Deops入门
Applet setting multi account debugging