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

目录
打赏
0
0
0
0
39
分享
相关文章
大数据-170 Elasticsearch 云服务器三节点集群搭建 测试运行
大数据-170 Elasticsearch 云服务器三节点集群搭建 测试运行
87 4
Hadoop-36 HBase 3节点云服务器集群 HBase Shell 增删改查 全程多图详细 列族 row key value filter
Hadoop-36 HBase 3节点云服务器集群 HBase Shell 增删改查 全程多图详细 列族 row key value filter
84 3
Hadoop-35 HBase 集群配置和启动 3节点云服务器 集群效果测试 Shell测试
Hadoop-35 HBase 集群配置和启动 3节点云服务器 集群效果测试 Shell测试
120 4
Hadoop-27 ZooKeeper集群 集群配置启动 3台云服务器 myid集群 zoo.cfg多节点配置 分布式协调框架 Leader Follower Observer
Hadoop-27 ZooKeeper集群 集群配置启动 3台云服务器 myid集群 zoo.cfg多节点配置 分布式协调框架 Leader Follower Observer
90 1
Hadoop-15-Hive 元数据管理与存储 Metadata 内嵌模式 本地模式 远程模式 集群规划配置 启动服务 3节点云服务器实测
Hadoop-15-Hive 元数据管理与存储 Metadata 内嵌模式 本地模式 远程模式 集群规划配置 启动服务 3节点云服务器实测
92 2
大数据-02-Hadoop集群 XML配置 超详细 core-site.xml hdfs-site.xml 3节点云服务器 2C4G HDFS Yarn MapRedece(一)
大数据-02-Hadoop集群 XML配置 超详细 core-site.xml hdfs-site.xml 3节点云服务器 2C4G HDFS Yarn MapRedece(一)
268 5
大数据-02-Hadoop集群 XML配置 超详细 core-site.xml hdfs-site.xml 3节点云服务器 2C4G HDFS Yarn MapRedece(二)
大数据-02-Hadoop集群 XML配置 超详细 core-site.xml hdfs-site.xml 3节点云服务器 2C4G HDFS Yarn MapRedece(二)
253 4
课时1:阿里云云服务器ECS介绍
阿里云ECS服务器解决了传统服务器采购周期长、资源闲置和维护成本高等问题。企业无需预先采购昂贵硬件,按需购买云服务,具备完善的架构、广泛场景覆盖及卓越性能,支持50多款操作系统,针对21个业务场景优化,提供上百种规格选择。ECS确保数据安全与业务连续性,历史可用性高达99.9999%,助力企业高效转型。
基于阿里云Serverless Kubernetes(ASK)的无服务器架构设计与实践
无服务器架构(Serverless Architecture)在云原生技术中备受关注,开发者只需专注于业务逻辑,无需管理服务器。阿里云Serverless Kubernetes(ASK)是基于Kubernetes的托管服务,提供极致弹性和按需付费能力。本文深入探讨如何使用ASK设计和实现无服务器架构,涵盖事件驱动、自动扩展、无状态设计、监控与日志及成本优化等方面,并通过图片处理服务案例展示具体实践,帮助构建高效可靠的无服务器应用。
阿里云轻量应用服务器38元1年性能、适用场景简单测评
在阿里云目前的活动中,轻量云服务器2核2G200M峰值带宽每天10点和15点抢购价只要38元一年,e实例云服务器2核2G3M带宽99元1年,u1实例2核4G5M带宽199元一年。其中,阿里云轻量应用服务器38元1年的抢购价,让不少用户心动不已。那么,这款特价轻量应用服务器到底怎么样?是否值得购买呢?本文将从配置、性能、适用场景、价格优势等多个方面对这款轻量应用服务器做个介绍,以供参考。
阿里云轻量应用服务器38元1年性能、适用场景简单测评
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等