Installing Supervisor and Superlance on CentOS
Installing Supervisor1 and Superlance2 on CentOS/RHEL/Fedora can be a little tricky, as the versions of those packages included in the main repositories are too old to be useful.
In this tutorial, I will show you how to make a stock install of the latest versions on CentOS, and will omit the configuration of Supervisor itself as that will be specific to your applications.
Installing Supervisor
As the super user, firstly install the Python setup tools to gain EasyInstall3, then use that to install Supervisor:
$ yum install python-setuptools
$ easy_install supervisor
You should now have the latest version installed:
$ supervisord --version
3.1.
Create a config file
Easy Install will not create a config file for Supervisor for you, but luckily Supervisor includes a utility called echo_supervisord_conf to generate a default configi file for you:
$ echo_supervisord_conf > /etc/supervisord.conf
You can now make changes directly to the new /etc/supervisord.conf file.
Running the service
While it is possible to start Supervisor using the supervisord command, I like to run services via an init script. Here is an example I use (placed in /etc/rc.d/init.d/supervisord):
#!/bin/bash . /etc/init.d/functions DAEMON=/usr/bin/supervisord
PIDFILE=/var/run/supervisord.pid [ -x "$DAEMON" ] || exit start() {
echo -n "Starting supervisord: "
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo supervisord already running: $PID
exit ;
else
daemon $DAEMON --pidfile=$PIDFILE -c /etc/supervisord.conf
RETVAL=$?
echo
[ $RETVAL -eq ] && touch /var/lock/subsys/supervisord
return $RETVAL
fi } stop() {
echo -n "Shutting down supervisord: "
echo
killproc -p $PIDFILE supervisord
echo
rm -f /var/lock/subsys/supervisord
return
} case "$1" in
start)
start
;;
stop)
stop
;;
status)
status supervisord
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status|restart}"
exit
;;
esac
exit $?
You will need to create that file, containing the above script, and make sure it's executable:
$ nano /etc/rc.d/init.d/supervisord
$ chmod /etc/rc.d/init.d/supervisord
You will now have access to the following commands to control Supervisor:
$ service supervisord start
$ service supervisord stop
$ service supervisord status
$ service supervisord restart
Superlance
Superlance is a set of additional plugins for Supervisor, that includes plugins for sending email or SMS alerts when a Supervisor process exists unexpectedly, for monitoring memory usage of Supervisor processes, and a few other useful monitoring and alerting utilities. You can also install it via EasyInstall:
$ easy_install superlance
References
Installing Supervisor and Superlance on CentOS的更多相关文章
- Installing Zabbix 3.2 in Centos 6.8 Clean Install Dependencies Errors
ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Troubleshooting and Problems > Ins ...
- [转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only
Okay for centos 6.4 also On apu.0xdata.loc, after this install was done $ which python /usr/local/bi ...
- Installing IPython using pip on CentOS
1. First to install pip # wget https://bootstrap.pypa.io/get-pip.py # python get-pip.py 2. Install i ...
- Installing Percona XtraDB Cluster on CentOS
PXC简介 Percona XtraDB Cluster(简称PXC集群)提供了MySQL高可用的一种实现方法. 1.集群是有节点组成的,推荐配置至少3个节点,但是也可以运行在2个节点上. 2.每个节 ...
- 使用superlance插件增强supervisor的监控能力
supervisor与superlance简介 supervisor是一款用python编写的进程监控.进程守护和进程管理的工具,可以工作在各种UNIX-like的操作系统上,通过简单的配置就可以启动 ...
- 利用superlance监控supervisor运行状态
此文已由作者张家裕授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 最近开发问到supervisor管理下的进程重启了,有无办法做到主动通知,楼主最先想到的是superviso ...
- 利用Superlance监控Supervisor运行状态并实现报警
Superlance是基于supervisor的事件机制实现的一系列命令行的工具集,它实现了许多supervisor本身没有实现的实用的进程监控和管理的特性,包括内存监控,http接口监控,邮件和短信 ...
- 在Linux CentOS 6.6上安装Python 2.7.9
CentOS 6.6自带的是Python 2.6.6,而编译llvm需要Python 2.7以上. checking for python... /usr/bin/python checking fo ...
- How to install Wordpress 4.0 on CentOS 7.0
This document describes how to install and configure Wordpress 4.0 on CentOS 7.0. WordPress started ...
随机推荐
- Spring Security OAuth2 SSO
通常公司肯定不止一个系统,每个系统都需要进行认证和权限控制,不可能每个每个系统都自己去写,这个时候需要把登录单独提出来 登录和授权是统一的 业务系统该怎么写还怎么写 最近学习了一下Spring Sec ...
- c# 中的封装、继承、多态详解
面向对象有封装.继承.多态这三个特性,面向对象编程按照现实世界的特点来管理复杂的事物,把它们抽象为对象,具有自己的状态和行为,通过对消息的反应来完成任务.这种编程方法提供了非常强大的多样性,大大增加了 ...
- leetcode — construct-binary-tree-from-inorder-and-postorder-traversal
import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://o ...
- leetcode — merge-sorted-array
import java.util.Arrays; /** * Source : https://oj.leetcode.com/problems/merge-sorted-array/ * * * G ...
- PE知识复习之PE的各种头属性解析
PE知识复习之PE的各种头属性解析 一丶DOS头结构体 typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header WORD e_magic; // M ...
- Spring之事件监听(观察者模型)
目录 Spring事件监听 一.事件监听案例 1.事件类 2.事件监听类 3.事件发布者 4.配置文件中注册 5.测试 二.Spring中事件监听分析 1. Spring中事件监听的结构 2. 核心角 ...
- [JavaScript] JavaScript事件注册,事件委托,冒泡,捕获,事件流
面试题 event 事件 事件委托是什么? 如何阻止事件冒泡,阻止默认事件呢? Javascript 的事件流模型都有什么? 事件绑定和普通事件有什么区别? Event 对象 Event 对象,当事件 ...
- 第一册:lesson 111.
原文:The most expensive model. question:Can Mr.Frith buy the television on instalments? How does it wo ...
- [MySQL] explain中的using where和using index
1. 查看表中的所有索引 show index from modify_passwd_log; 有两个 一个是id的主键索引 , 一个是email_id的普通索引 2. using index表示 ...
- 学JAVA的第二天,静态网站制作,脑阔一点疼
先从下载apache-tomcat-9.0.17开始 在下边这个网站下载,下边一步步来 下面删除的这些是暂时用不上的,先吧它删除了,因为会拖慢启动速度 下边把ROOT里边除WEB-INF外的全不删除了 ...