当前位置: 首页 > 工具软件 > cesi > 使用案例 >

cesi 部署配置

翟柏
2023-12-01

安装

wget https://github.com/gamegos/cesi/releases/download/v2.6.7/cesi-extended.tar.gz -O cesi.tar.gz
tar -zxvf cesi.tar.gz

# 创建venv虚拟环境(也可以使用已有的虚拟环境)
python3 -m venv venv

# 激活venv虚拟环境
source venv/bin/activate
# 在venv虚拟环境中,使用pip3管道安装依赖
pip3 install -r requirements.txt
# 失效venv虚拟环境
deactivate

# 复制配置文件到/etc目录
cp ${CESI_SETUP_PATH}/defaults/cesi.conf.toml /etc/cesi.conf

# 复制服务配置文件到/etc/systemd/system目录,并注册为服务(CentOS7)
cp ${CESI_SETUP_PATH}/defaults/cesi.service /etc/systemd/system/cesi.service

配置

mysql作为源数据

[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 = "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 = "demo"
environment = "demo"
username = "admin"  #supervisord web 的用户名
password = "123456" #密码
host = "127.0.0.1"
port = "19001"

启动:

修改启动端口:
python3 /data/package/cesi/cesi/run.py --config-file /etc/cesi.conf -p 5023

报错1:

AttributeError: 'sqlalchemy.cimmutabledict.immutabledict' object has no attribute 'setdefault'

解决:
pip3 install --upgrade 'SQLAlchemy<1.4'

报错2:

sqlalchemy.exc.TimeoutError: QueuePool limit of size 10 overflow 10 reached


解决:
vim run.py 
添加"pool_size=100"
app.config["SQLALCHEMY_DATABASE_URI", "pool_size=100"] = cesi.database

 类似资料: