详细解读cesi+supervisor可视化集中管理服务器节点进程

简介: 详细解读cesi+supervisor可视化集中管理服务器节点进程

Supervisor 的安装及基本使用

supervisor 文章跳转

开启supervisor 的 web服务

【inet_http_server】 ;HTTP服务器,提供web管理界面

port=0.0.0.0:9001 ;Web管理后台运行的IP和端口,如果开放到公网,需要注意安全性

username=root ;登录管理后台的用户名

password=123 ;登录管理后台的密码

安装配置 CeSi

1. 简介

CeSi 是 Supervisor 官方推荐的集中化管理 Supervisor 实例的 Web UI,该工具是用 Python 编写,基于 Flask Web 框架 。

Superviosr 自带的 Web UI 不支持跨机器管理

Supervisor 进程,功能比较简单,通过 CeSi 可以集中管理各个服务器节点的进程,在 Web 界面就可以轻松管理各个服务的启动、关闭、重启等,很方便使用。

2. 安装

CeSi 已经有了新的版本,在 GitHub 仓库的 v2_api 分支下,提供了比之前版本更加美观的界面,以下为 CeSi 一键安装配置脚本:

yum install wget

yum install git

python 安装

export CESI_SETUP_PATH=~/cesi

mkdir ${CESI_SETUP_PATH}//代码效果参考:http://www.ezhiqi.com/bx/art_1147.html

cd ${CESI_SETUP_PATH}

# Download the project to ~/cesi directory

wget -O cesi.tar.gz

tar -xvf cesi.tar.gz

# Create virtual environment and install requirement packages

python3 -m venv venv

source venv/bin/activate

pip3 install -r requirements.txt

3. 配置

# Create cesi conf

cp /usr/local/defaults/cesi.conf.toml /etc/cesi.conf

vim /etc/cesi.conf

【cesi】

# Database Uri

database = "" # Relative path

# Etc

#database = "" # Absolute path

#database = "

@localhost:5432/"

#database = "mysql+

@localhost:3306/"

activity_log = "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 = "count_1"

environment = "count"

username = "root"

password = "123"

host = "192.168.0.239"

port = "9190"

【【nodes】】

name = "count_2"

environment = "count"

username = "root"

password = "123"

host = "192.168.0.240"

port = "9190"

【【nodes】】

name = "count_3"

environment = "count"

username = "root"

password = "123"

host = "192.168.0.71"

port = "9190"

注意:CeSi 的配置文件路径必须是 /etc/cesi.conf ,否则启动会报错,简单看下 CeSi 的源码就知道为什么了。在这里我在仓库目录弄了个软连接指向了 /etc/cesi.conf,完全是为了编辑方便弄的。

4. 启动

CeSi 的启动非常简单,直接通过 Python 启动即可:

/usr/local/venv/bin/python3 /usr/local/cesi/run.py --config-file /etc/cesi.conf -p 9191

1

为了方便管理,我把 CeSi 也通过 Supervisor 来管理,以下为对应的 Supervisor 配置:

创建日志文件

mkdir -p /var/log/supervisor/cesi/

【program:cesi】

directory=/usr/local/cesi

command=/usr/local/venv/bin/python3 /usr/local/cesi/run.py --config-file /etc/cesi.conf -p 9191

stderr_logfile=/var/log/supervisor/cesi/cesi.log

stdout_logfile=/var/log/supervisor/cesi/cesi.out

autostart=true

autorestart=true

stopasgroup=true

killasgroup=true

startsecs=180

相关文章
|
10天前
|
存储 算法 搜索推荐
Cloudstack多个管理服务器节点
Cloudstack多个管理服务器节点
7 0
|
11天前
|
数据可视化 API 开发工具
详细解读cesi+supervisor可视化集中管理服务器节点进程
详细解读cesi+supervisor可视化集中管理服务器节点进程
19 0
|
15天前
|
数据可视化 网络协议 Linux
Linux 怎样通过win 远程桌面连接链接Linux后台服务器的可视化图形界面
Linux 怎样通过win 远程桌面连接链接Linux后台服务器的可视化图形界面
16 0
|
2月前
|
SQL NoSQL 关系型数据库
实时计算 Flink版产品使用合集之mysql服务器只有1个节点,怎么改mysqlserver-id
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStreamAPI、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
|
1月前
|
监控 NoSQL Redis
Redis哨兵,Redis哨兵核心功能如何一个云服务器完成6个节点的搭建-docker什么是docker是否可以把六个容器,都写到同一个ym配置中,一次都启动,不就直接保证互通问题了吗?
Redis哨兵,Redis哨兵核心功能如何一个云服务器完成6个节点的搭建-docker什么是docker是否可以把六个容器,都写到同一个ym配置中,一次都启动,不就直接保证互通问题了吗?
|
2月前
LabVIEW使用VI服务器的调用节点将数据传递到另一个VI 使用调用节点(Invoke Node)与通过引用调用节点(Call by Reference)调用VI时有什么差别?
LabVIEW使用VI服务器的调用节点将数据传递到另一个VI 使用调用节点(Invoke Node)与通过引用调用节点(Call by Reference)调用VI时有什么差别?
28 0
|
7天前
|
弹性计算 缓存 安全
阿里云服务器ECS收费标准参考,2核4G配置ECS实例规格整理
阿里云提供多种2核4G ECS实例,如计算型c7、经济型e、u1等,价格不等,从68.0元/月到203.0元/月。ECS通用算力型u1实例采用高性能Intel处理器,网络收发包能力达30万PPS。经济型e实例基于Intel Xeon Platinum,适合入门级需求。2核4G服务器支持的并发访问人数依赖于软件效率、带宽、应用架构和用户行为等因素。更多信息请查看阿里云ECS产品页。
|
2天前
|
弹性计算
阿里云ECS的使用心得
本文主要讲述了我是如何了解到ECS,使用ECS的一些经验,以及自己的感悟心得
|
4天前
|
弹性计算 运维 Kubernetes
阿里云ECS与混合云策略结合,提供云上云下无缝对接,提升业务灵活性和运维效率。
【7月更文挑战第3天】阿里云ECS与混合云策略结合,提供云上云下无缝对接,提升业务灵活性和运维效率。ECS支持多种计费模式和先进架构,保证低延迟计算。混合云融合公有云灵活性与私有云安全,实现资源最优配置。通过VPC互通、应用迁移、数据同步实践,确保安全合规,助力企业数字化转型。阿里云服务展示技术实力,支持企业在混合云时代抓住机遇。
28 3
|
3天前
|
弹性计算
阿里云ECS的使用心得
本文主要讲述了我是如何了解到ECS,使用ECS的一些经验,以及自己的感悟心得