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 ...
随机推荐
- React Native (二) ios打包到真机
每当在模拟器上完成了开发,都想到真机上试试,正好前段时候淘了一个imac. 这里就以打包rndemo到iphone为例,讲一下react ntive ios打包到真机的流程. 一.前置 1.有个iph ...
- 痞子衡嵌入式:语音处理工具Jays-PySPEECH诞生记(1)- 环境搭建(Python2.7.14 + PyAudio0.2.11 + Matplotlib2.2.3 + SpeechRecognition3.8.1 + pyttsx3 2.7)
大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是语音处理工具Jays-PySPEECH诞生之环境搭建. 在写Jays-PySPEECH时需要先搭好开发环境,下表列出了开发过程中会用到的 ...
- 大前端的自动化工厂(5)—— 基于Karma+Mocha+Chai的单元测试和接口测试
一. 前端自动化测试 大多数前端开发者对测试相关的知识是比较缺乏的,一来是开发节奏很快,来不及写,另一方面团队里也配备了"人肉测试机",完全没必要自己来.但随着项目体量的增大,许多 ...
- js如何使用正则表达式实现过滤HTML标签?(/<[^<>]+>/g)
js如何使用正则表达式实现过滤HTML标签?(/<[^<>]+>/g) 一.总结 js进阶正则表达式实现过滤HTML标签(<>标签中不能包含标签实现过滤HTML标签 ...
- C#/VB.NET 操作Word批注(二)——如何插入图片、读取、回复Word批注内容
序 在前面的文章C# 如何插入.修改.删除Word批注一文中介绍了如何操作Word批注的一些方法,在本篇文章中继续介绍操作Word批注的方法.分以下三种情况来介绍: 1. 插入图片到Word批注 2. ...
- JAVA程序员面试30问(附带答案)
第一,谈谈final, finally, finalize的区别. 最常被问到.final修饰符(关键字)如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承.因此一个类不能 ...
- mysql 错误 ERROR 1030 Got error 28 from
错误SQL 查询:编辑SHOWFULLFIELDSFROM`表`FROM`数据库`; MySQL 返回:#1030 - Got error 28 from storage engine 根据返回值,可 ...
- 对HTML5标签的认识(二)
---恢复内容开始--- 这次随笔主要讲一下列表标签.链接标签.和表格标签.图像标签.音频标签.及视频标签的运用及作用. 一.<ul>和<ol> 首先先了解一下<ul&g ...
- Springcloud 的Eureka和ZooKeeper比较
关于CAP理论,可以去看看阮一峰的文章[http://www.ruanyifeng.com/blog/2018/07/cap.html] C(一致性)A(可用性)P(分区容错性) ZooKeeper: ...
- 一句话总结K均值算法
一句话总结K均值算法 核心:把样本分配到离它最近的类中心所属的类,类中心由属于这个类的所有样本确定. k均值算法是一种无监督的聚类算法.算法将每个样本分配到离它最近的那个类中心所代表的类,而类中心的确 ...