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

Background

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

1、部署环境

itemversion
Centos7.9
Python3.7.8
Flask2.2.5
Flask-SQLAlchemy2.5.1
psycopg2-binary2.8.5
PyMySQL0.9.3
SQLAlchemy1.4.48
CeSi2.7.1

Supervisor官方文档地址:http://supervisord.org/plugins.html#dashboards-and-tools-for-multiple-supervisor-instances
Cesi git地址:https://github.com/gamegos/cesi

  • 最终效果
    在这里插入图片描述
    在这里插入图片描述

2、安装依赖

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

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

  • 创建日志目录
mkdir -p /opt/cesi/logs/
  • /etc/cesi.conf.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
[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
  • 配置系统管理
systemctl daemon-reload
systemctl enable cesi

5、启动CeSi

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

6、访问CeSi

  • 浏览器访问 http://IP:5000
  • 默认用户名/密码admin/admin
  • 注意:默认用户名密码不要改,改了进不去,我在这里踩坑了

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WaiSaa

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值