1.3 源码部署


洞察2 源码部署简介

采用源码部署insight2服务

(1) 准备Mysql服务, Redis服务, Python3.7环境。

(2) Mysql数据库初始化

mysql -u user -p password -h host < init/init.sql

(3) 依赖

yum install -y epel-release wget gcc make zlib-devel libffi-devel bind-utils openssl-devel supervisor crontabs.noarch

pip install -r requirements.txt

(3) 配置文件修改

DEBUG = True
# 服务默认端口
PORT = 8000
# 数据库配置
DB_HOST = 'web_mysql'
DB_PORT = 3306
DB_NAME = 'insight2'
DB_USER = 'root'
DB_PASS = 'crediteaseitsec'
# Redis配置
REDIS_HOST = 'web_redis'
REDIS_PORT = 6379
REDIS_PASS = 'crediteaseitsec'
REDIS_DB = 0
REDIS_CHANNEL = "SERVICE_CHANNEL"


ACTION_DIR_NAME = ("action", )

STATIC_DIR_NAME = "upload"

TEMPLATE_DIR_NAME = "template"

COOKIE_SECRET = "kG6QcnqzQAGqE2zg2DYyv8q19f78zUz7nvH/KkoodTY="
# 接口前缀
API_VERSION = "/api"

# 洞察1  数据迁移使用,可不做配置,如果进行数据迁移,请配置成洞察1数据库信息。
FROM_DB = dict(
            host = 'web_mysql',
            port = 3306,
            user = "root",
            password = "crediteaseitsec",
            database = "insight"
        )

(4) backend 服务启动

python run.py --config=settings.py --port=8000
python service.py --config=settings.py
启动linux系统cron服务

或者

supervisord -c supervisord.conf

(5) 目录介绍

.
├── action                                                     //RequestHandler接口文件
├── init                                                        // 数据库初始化sql
├── logic                                                      // 逻辑代码
├── logs                                                        // 日志目录
├── static                                                   // 前端编译完成将dist/static下的静态文件拷贝到此目录;将index.html拷贝到此目录下
│   ├── css
│   ├── fonts
│   ├── img
│   └── js
├── template
├── tornadoweb                                         // tornado 封装
├── transfer_data                                  // 数据迁移
Copyright Cesec Dev Team 2020 all right reserved,powered by Gitbook该文章修订时间: 2020-08-17 10:14:25

results matching ""

    No results matching ""