- 资产录入,查询,管理
- 资产信息自动搜集
- Web Terminal登录
- 操作审计,录像回放
- python3.7
- Tornado4.5
- DRF3.9
- MYSQL
yum -y install $(cat rpm_requirements.txt)
pip3 install --upgrade pip
pip3 install -r requirements.txt
- 配置文件 cmdb.conf
- 配置数据库信息
cp /var/www/CMDB/cmdb-example.conf /var/www/CMDB/cmdb.conf
mysql -h 127.0.0.1 -u root -p123456 -e "create database cmdb default character set utf8mb4 collate utf8mb4_unicode_ci;"
mysql -h 127.0.0.1 -u root -p123456 cmdb < docs/cmdb.sql
cat >> /etc/supervisord.conf <<EOF
[program:cmdb]
command=python3 startup.py --port=90%(process_num)02d
process_name=%(program_name)s_%(process_num)02d
numprocs=3
directory=/var/www/CMDB
user=root
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/cmdb.log
loglevel=info
logfile_maxbytes=100MB
logfile_backups=3
EOF
supervisorctl update
supervisorctl reload
upstream cmdb{
server 127.0.0.1:9000;
server 127.0.0.1:9001;
server 127.0.0.1:9002;
}
location /v1/cmdb/ws/ {
#proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://cmdb;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /api/cmdb/ {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://cmdb;
}
Everything is GPL v3.0.