Centos7安装Cesi(Supervisor集中管理工具)

Background

  • CeSi 是 Supervisor 官方推荐的集中化管理 Supervisor 实例的 Web UI,该工具是用 Python 编写,基于 Flask Web 框架 。
  • Superviosr 自带的 Web UI 不支持跨机器管理Supervisor 进程,功能比较简单,通过 CeSi 可以集中管理各个服务器节点的进程,在 Web 界面就可以轻松管理各个服务的启动、关闭、重启等,方便使用。
  • 当前部署环境:CentOS7.9Python3.7.8

1、部署环境

item version
Centos 7.9
Python 3.7.8
Flask 2.2.5
Flask-SQLAlchemy 2.5.1
psycopg2-binary 2.8.5
PyMySQL 0.9.3
SQLAlchemy 1.4.48
CeSi 2.7.1

Supervisor官方文档地址:http://supervisord.org/plugins.html#dashboards-and-tools-for-multiple-supervisor-instances

Cesi git地址:https://github.com/gamegos/cesi

  • 最终效果

2、安装依赖

shell 复制代码
yum install -y git wget epel-release npm bzip2
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
yum install -y yarn

3、部署CeSi

shell 复制代码
cd /opt/
wget https://github.com/gamegos/cesi/releases/download/v2.7.1/cesi-extended.tar.gz
cd cesi/
pip3 install -r requirements.txt
cd /opt/cesi/ui/
yarn install
yarn build

4、配置CeSi

  • 创建日志目录
shell 复制代码
mkdir -p /opt/cesi/logs/
  • /etc/cesi.conf.toml
toml 复制代码
# This is the CeSI's own configuration.
[cesi]
# Database Uri
database = "sqlite:///users.db"                         # Relative path
# Etc
#database = "sqlite:opt/cesi/< version >/users.db"  # Absolute path
#database = "postgres://<user>:<password>@localhost:5432/<database_name>"
#database = "mysql+pymysql://<user>:<password>@localhost:3306/<database_name>"
activity_log = "/opt/cesi/logs/activity.log"   # File path for CeSI logs
admin_username = "admin"        # Username of admin user
admin_password = "admin"        # Password of admin user

# This is the definition section for new supervisord node.
# [[nodes]]
# name = "api"          # (String) Unique name for supervisord node.
# environment = ""      # (String) The environment name provides logical grouping of supervisord nodes. It can be used as filtering option in the UI.
# username = ""         # (String) Username of the XML-RPC interface of supervisord Set nothing if no username is configured
# password = ""         # (String) Password of the XML-RPC interface of supervisord. Set nothing if no username is configured
# host = "127.0.0.1"    # (String) Host of the XML-RPC interface of supervisord
# port = "9001"         # (String) Port of the XML-RPC interface of supervisord

# Default supervisord nodes
[[nodes]]
name = "elephant"
environment = "dev"
username = "admin"
password = "admin"
host = "elephant"
port = "9001"

[[nodes]]
name = "test"
environment = "test"
username = "admin"
password = "admin"
host = "test"
port = "9001"

[[nodes]]
name = "app"
environment = "prod"
username = "admin"
password = "admin"
host = "app"
port = "9001"

[[nodes]]
name = "app01"
environment = "prod"
username = "admin"
password = "admin"
host = "app01"
port = "9001"
  • /etc/systemd/system/cesi.service
service 复制代码
[Unit]
Description=cesi

[Service]
Environment=
ExecStart=/usr/bin/python3 /opt/cesi/cesi/run.py --config-file /etc/cesi.conf.toml
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=TERM
User=root
WorkingDirectory=/opt/cesi

Restart=on-failure

[Install]
WantedBy=multi-user.target
  • 配置系统管理
shell 复制代码
systemctl daemon-reload
systemctl enable cesi

5、启动CeSi

shell 复制代码
systemctl start cesi
# 启动正常查看信息无报错,有报错根据报错信息排查解决
systemctl status cesi

6、访问CeSi

  • 浏览器访问 http://IP:5000
  • 默认用户名/密码admin/admin
  • 注意:默认用户名密码不要改,改了进不去,我在这里踩坑了
相关推荐
何大春15 分钟前
【弱监督语义分割】Self-supervised Image-specific Prototype Exploration for WSSS 论文阅读
论文阅读·人工智能·python·深度学习·论文笔记·原型模式
在下不上天23 分钟前
Flume日志采集系统的部署,实现flume负载均衡,flume故障恢复
大数据·开发语言·python
SEVEN-YEARS27 分钟前
深入理解TensorFlow中的形状处理函数
人工智能·python·tensorflow
EterNity_TiMe_32 分钟前
【论文复现】(CLIP)文本也能和图像配对
python·学习·算法·性能优化·数据分析·clip
Suyuoa43 分钟前
附录2-pytorch yolov5目标检测
python·深度学习·yolo
好看资源平台2 小时前
网络爬虫——综合实战项目:多平台房源信息采集与分析系统
爬虫·python
进击的六角龙2 小时前
深入浅出:使用Python调用API实现智能天气预报
开发语言·python
檀越剑指大厂2 小时前
【Python系列】浅析 Python 中的字典更新与应用场景
开发语言·python
湫ccc2 小时前
Python简介以及解释器安装(保姆级教学)
开发语言·python
孤独且没人爱的纸鹤2 小时前
【深度学习】:从人工神经网络的基础原理到循环神经网络的先进技术,跨越智能算法的关键发展阶段及其未来趋势,探索技术进步与应用挑战
人工智能·python·深度学习·机器学习·ai