Supervisor安装配置步骤

下载meld3

https://centos.pkgs.org/7/epel-x86_64/python-meld3-0.6.10-1.el7.x86_64.rpm.html

把文件上传到`/data/aics`

安装meld3

`cd /data/aics`

` rpm -ivh python-meld3-0.6.10-1.el7.x86_64.rpm`

下载 setuptools

http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

把文件上传到`/data/aics`

安装setuptools

`cd /data/aics`

`tar -zxvf setuptools-0.6c11.tar.gz`

`cd setuptools-0.6c11`

`python setup.py build`

`python setup.py install`

下载Supervisor

https://pypi.python.org/packages/80/37/964c0d53cbd328796b1aeb7abea4c0f7b0e8c7197ea9b0b9967b7d004def/supervisor-3.3.1.tar.gz

把文件上传到`/data/aics`

安装Supervisor

`cd /data/aics`

`tar -zxvf supervisor-3.3.1.tar.gz`

`cd supervisor-3.3.1`

`python setup.py install`

配置Supervisor

`mkdir -p /etc/supervisor/`

`echo_supervisord_conf > /etc/supervisor/supervisord.conf`

如主机地址为`192.168.117.129`

`vi /etc/supervisor/supervisord.conf`

加入如下配置


[include]

files =/etc/supervisor/*.conf


如需在页面操作加入如下配置


[inet_http_server]        ; inet (TCP) server disabled by default

port=192.168.117.129: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))


添加子进程,以添加tomcat进程为例

如`tomcat`安装路径为`/data/aics/tomcat`

`cd /etc/supervisor`

`touch tomcat.conf`

`vi tomcat.conf`

加入如下配置


[program:tomcat]

command=/data/aics/tomcat/bin/catalina.sh run

directory=/data/aics/tomcat

process_name=%(program_name)s


启动

`supervisord -c  /etc/supervisor/supervisord.conf`

使用

查看supervisor监管的进程状态`supervisorctl status`

启动XXX进程`supervisorctl start 进程名`

停止XXX进程`supervisorctl stop 进程名`

停止全部进程`supervisorctl stop all`

根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启`supervisorctl update`

页面使用

打开浏览器:`http://192.168.117.129:9001`

使用用户名`user`和密码`123`进入系统

你可能感兴趣的:(Supervisor安装配置步骤)