李子

OpsManage v3部署文档
开发语言与框架:编程语言:Python3.6 + HTML + JScripts前端Web框架:Bootstrap...
扫描右侧二维码阅读全文
08
2019/04

OpsManage v3部署文档

开发语言与框架:

编程语言:Python3.6 + HTML + JScripts
前端Web框架:Bootstrap
后端Web框架:Django
后端Task框架:Celery + Redis
OpsManage环境要求

编程语言:Python 3.6
操作系统:CentOS 6+
Ansible版本:2.6 +
部署平台及节点服务器:Rsync 3+
MySQL版本:5.1-5.6

官网文档有点小问题,自己贴一份。我的系统是centos7.6,你是6的话别照搬谢谢。

装下epel企业源:
yum -y install epel-release

安装python3:

yum install zlib zlib-devel readline-devel sqlite-devel bzip2-devel openssl-devel gdbm-devel libdbi-devel ncurses-libs kernel-devel libxslt-devel libffi-devel python-devel zlib-devel openldap-devel sshpass gcc git -y
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm
yum -y update percona-release
yum install Percona-Server-server-56 install Percona-Server-devel-56
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz  
tar -xzvf Python-3.6.6.tgz
cd Python-3.6.6
./configure --prefix=/usr/local/python3
make all
make install
make clean
make distclean  
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

安装模块:

cd /mnt/
git clone -b v3 https://github.com/welliamcao/OpsManage.git
cd /mnt/OpsManage/
pip3 install -r requirements.txt 
/usr/local/python3/bin/easy_install-3.6 paramiko==2.4.1

安装redis:

yum -y install redis
systemctl start redis

mysql环境配置:

vim /etc/my.cnf
[mysqld]
character_set_server = utf8
添加以上字段
systemctl start mysql.service 
# mysql -uroot -p                  #初始密码为空,直接回车就行
mysql> create database opsmanage DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> grant all privileges on opsmanage.* to root@'localhost' identified by 'password';
mysql> grant all privileges on opsmanage.* to root@'127.0.0.1' identified by 'password';
mysql> flush privileges;

配置OpsManage:

cd /mnt/OpsManage/conf
vim opsmanage.ini
根据自己的情况修改配置

生成数据表与管理员账户:

pip3 uninstall python-ldap
pip3 install --upgrade python-ldap
cd /mnt/OpsManage/
/usr/local/python3/bin/python3 manage.py makemigrations OpsManage
/usr/local/python3/bin/python3 manage.py makemigrations wiki
/usr/local/python3/bin/python3 manage.py makemigrations orders
/usr/local/python3/bin/python3 manage.py makemigrations filemanage
/usr/local/python3/bin/python3 manage.py makemigrations navbar
/usr/local/python3/bin/python3 manage.py makemigrations databases
/usr/local/python3/bin/python3 manage.py makemigrations asset
/usr/local/python3/bin/python3 manage.py makemigrations deploy
/usr/local/python3/bin/python3 manage.py makemigrations apps
/usr/local/python3/bin/python3 manage.py makemigrations sched
/usr/local/python3/bin/python3 manage.py migrate
#创建管理员账户与密码
/usr/local/python3/bin/python3 manage.py createsuperuser  

启动部署平台:

yum -y install tmux
tmux
cd /mnt/OpsManage/
/usr/local/python3/bin/python3 manage.py runserver 0.0.0.0:8000

使用OpsManage分布式任务调度功能,不使用的话可以不进行下面的步骤:

# mkdir -p /usr/local/opsched
# cp /mnt/OpsManage/opsched/* /usr/local/opsched/
# vim /usr/local/opsched/sched.conf 
# 注意修改里面secret跟ops_address的值,修改成自己的配置
# /usr/local/opsched/opsched -f /usr/local/opsched/sched.conf -a check      #检查配置看看有没有报错
# /usr/local/opsched/opsched -f /usr/local/opsched/sched.conf -a runserver  #正式运行 
最后修改:2019 年 04 月 09 日 09 : 44 AM
如果觉得我的文章对你有用,请随意赞赏

1 条评论

  1. axiba

    666 真香警告

发表评论