详细解读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

相关文章
|
12月前
|
Kubernetes API 网络安全
当node节点kubectl 命令无法连接到 Kubernetes API 服务器
当Node节点上的 `kubectl`无法连接到Kubernetes API服务器时,可以通过以上步骤逐步排查和解决问题。首先确保网络连接正常,验证 `kubeconfig`文件配置正确,检查API服务器和Node节点的状态,最后排除防火墙或网络策略的干扰,并通过重启服务恢复正常连接。通过这些措施,可以有效解决与Kubernetes API服务器通信的常见问题,从而保障集群的正常运行。
957 17
|
12月前
|
数据库
【YashanDB知识库】服务器重启后启动yasom和yasagent进程时有告警
【YashanDB知识库】服务器重启后启动yasom和yasagent进程时有告警
|
12月前
|
数据库
【YashanDB知识库】服务器重启后启动yasom和yasagent进程时有告警
本文介绍了YashanDB在特定场景下的问题分析与解决方法。当使用yasboot重启数据库后,yasom和yasagent进程虽启动成功但出现告警,原因是缺少libnsl.so.1库文件或环境变量配置错误。解决步骤包括:检查系统中是否存在该库文件,若不存在则根据操作系统类型安装(有外网时通过yum或apt,无外网时创建符号链接),若存在则调整环境变量配置,并重新启动相关进程验证问题是否解决。
|
SQL 分布式计算 NoSQL
大数据-170 Elasticsearch 云服务器三节点集群搭建 测试运行
大数据-170 Elasticsearch 云服务器三节点集群搭建 测试运行
413 4
|
分布式计算 Hadoop Shell
Hadoop-35 HBase 集群配置和启动 3节点云服务器 集群效果测试 Shell测试
Hadoop-35 HBase 集群配置和启动 3节点云服务器 集群效果测试 Shell测试
368 4
|
分布式计算 Hadoop Shell
Hadoop-36 HBase 3节点云服务器集群 HBase Shell 增删改查 全程多图详细 列族 row key value filter
Hadoop-36 HBase 3节点云服务器集群 HBase Shell 增删改查 全程多图详细 列族 row key value filter
268 3
|
5月前
|
弹性计算 运维 安全
阿里云轻量应用服务器与云服务器ECS啥区别?新手帮助教程
阿里云轻量应用服务器适合个人开发者搭建博客、测试环境等低流量场景,操作简单、成本低;ECS适用于企业级高负载业务,功能强大、灵活可扩展。二者在性能、网络、镜像及运维管理上差异显著,用户应根据实际需求选择。
441 10
|
5月前
|
运维 安全 Ubuntu
阿里云渠道商:服务器操作系统怎么选?
阿里云提供丰富操作系统镜像,涵盖Windows与主流Linux发行版。选型需综合技术兼容性、运维成本、安全稳定等因素。推荐Alibaba Cloud Linux、Ubuntu等用于Web与容器场景,Windows Server支撑.NET应用。建议优先选用LTS版本并进行测试验证,通过标准化镜像管理提升部署效率与一致性。
|
5月前
|
弹性计算 ice
阿里云4核8g服务器多少钱一年?1个月和1小时价格,省钱购买方法分享
阿里云4核8G服务器价格因实例类型而异,经济型e实例约159元/月,计算型c9i约371元/月,按小时计费最低0.45元。实际购买享折扣,1年最高可省至1578元,附主流ECS实例及CPU型号参考。
599 8