Code Monkey home page Code Monkey logo

supervisor's Introduction

supervisor

Supervisor是一个c/s架构的进程管理工具,提供web页面管理及xmlrpc接口,能对进程进行自动重启等操作。 适用于对项目中多个服务进行统一管理。文档: http://www.supervisord.org/

安装

git clone https://github.com/cheenwe/supervisor /opt/supervisor
cd /opt/supervisor
pip install supervisor-4.2.1-py2.py3-none-any.whl

sudo ln -sf /opt/supervisor/supervisord.conf /etc/
## 设置 supervisor 开机启动
sudo cp supervisor.service  /lib/systemd/system/
sudo systemctl enable --now supervisor.service  

访问服务

http://127.0.0.1:9001

用户名: admin
密码: admin2020

可在 supervisor.conf 文件中修改端口及用户名密码。

服务配置

为方便维护各个服务,每个服务一个配置文件进行管理,服务文件名需和配置文件中 program 保持一致,示例:

issh

常用命令

service supervisor status 
service supervisor restart 
supervisorctl status issh # 查看 ssh 服务状态
supervisorctl start issh
supervisorctl stop issh
supervisorctl reload: 重新启动配置中的所有程序
supervisorctl update # 配置文件修改后,重新加载配置

XML-RPC API

# pip install xmlrpclib

import xmlrpclib
server = xmlrpclib.Server('http://admin:[email protected]:9001/RPC2')
methods = server.system.listMethods()
print(methods)

其他

安装supervisor时需要装很多python依赖,为了简便使用该服务,有大神使用golang重写了该程序, 可直接运行该服务更多参见: https://github.com/ochinchina/supervisord

  • 在线安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install supervisor

supervisor's People

Contributors

cheenwe avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.