Supervisor 安装与配置

企鹅博客
企鹅博客
企鹅博客
20657
文章
0
评论
2019年7月12日12:32:46 评论 2.8K views 2204字阅读7分20秒

[Supervisor]

全选 复制 放进笔记

http://supervisord.org/

[Python]

如果没有,自己去装吧,一般 linux 自带了.

[easy_install]

全选 复制 放进笔记

[root@vm source]# wget https://bootstrap.pypa.io/ez_setup.py -O - | python

[安装superviosr]

全选 复制 放进笔记

[root@vm source]# easy_install supervisor

[状态]

全选 复制 放进笔记

[root@vm source]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:37:14) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import supervisor
>>>

[配置文件]

全选 复制 放进笔记

[root@vm source]# echo_supervisord_conf > /etc/supervisord.conf

[监视一个程序]

全选 复制 放进笔记

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include] /**我是注释,一定要把前面的分号;去掉,不然不会开启include功能,太傻了**/
files = /etc/supervisor/*.ini 

/etc/supervisor/ 目录下建立 redis.ini 文件

全选 复制 放进笔记

[program:redis]
command=/usr/bin/redis-server /usr/local/redis/redis.conf
autorstart=true
autorestart=true
stdout_logfile=/tmp/supervisor.log

[Web配置]

全选 复制 放进笔记

[inet_http_server]         ; inet (TCP) server disabled by default
port=*:9001        ; (ip_address:port specifier, *:port for all iface)
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

如果配置了用户名和密码,就需要输入用户名和密码才能进入web界面。

[启动supervisord]

全选 复制 放进笔记

[root@vm source]# supervisord

可能会输出一堆信息出来

/usr/lib/python2.6/site-packages/supervisor-3.1.3-py2.6.egg/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
/usr/lib/python2.6/site-packages/supervisor-3.1.3-py2.6.egg/supervisor/options.py:383: DeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
  return pkg_resources.EntryPoint.parse("x="+spec).load(False)

不用管它

全选 复制 放进笔记

  [root@vm source]# ps -ef |grep supervisord
  root     20041     1  0 03:21 ?        00:00:00 /usr/bin/python /usr/bin/supervisord

  [root@vm source]# ps -ef| grep redis
  root     20074 20073  0 03:23 ?        00:00:00 /usr/bin/redis-server *:6379

有上述进程,就表明成功了。

[WEB管理界面]

全选 复制 放进笔记

[[email protected] source]# supervisorctl status
redis                            RUNNING   pid 20074, uptime 0:13:25
继续阅读
weinxin
欢迎加入中国站长博客之家
本站的所有资源都会上传分享到博客之家,希望大家互相学习交流进步。
Spark源码走读 linux服务器应用

Spark源码走读

RDD全称Resilient Distributed DataSets,弹性的分布式数据集。是Spark的核心内容。 RDD是只读的,不可变的数据集,也拥有很好的容错机制。他有5个主要特性  ...
多节点部署Cassandra集群 linux服务器应用

多节点部署Cassandra集群

这篇文章收集了我从Apache Cassandra官网部署Cassandra集群的步骤。下面的步骤是我分享的部署集群的过程。大致分为三步 部署第一个节点 增加其他节点 监视集群(工具nodetool、...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: