Giter VIP home page Giter VIP logo

auto_cmdb's Introduction

运维平台搭建过程


https://www.jianshu.com/p/26624ca55212

开发环境

centos 6.5 django 1.8.18 python 2.7

######此版本基于linuxhub/lmanager的基础上做的开发

运维平台基于saltstack的接口调用来实现,操作管理,用户管理,权限管理,jenkins代码发布,作业管理,任务编排等系统,有监控管理系统,监控告警,模板管理和维护周期。

安装步骤(基本环境,需要安装好(Django、south、MySQLdb、celery模块)安装过程报错就继续安装模块即可):

pip install 'django==1.8.1'`

pip install south

pip install MySQL-python

pip install django-celery

pip install celery

1、在服务端建立/web目录。把项目拷贝到目录下。

2、在服务起端执行脚本:(在/CMDB/app/backend目录存放)

install_server.sh

3、在cp 客户端脚本到client执行,注意执行格式:

./install_client.sh client 192.168.63.239     

client表示客户端主机ID,建议跟主机的Hostname一致,,后面的IP表示server端的IP地址。

4、安装完成之后;测试是否成功:在server执行命令如下:

[root@master backend]# salt '*' test.ping
    client:
        True
    
有这个返回值说明成功安装了,saltstack的master 和客户端。

5、在server端同步client脚本到client:

salt '*' saltutil.sync_all

6、在server端安装salt-api,因为大部分操作都是调用api,可以参考博客(因为需要手工指定证书,所以没有做成脚本的形式):

7、建立mysql 数据库并且授权账号登录:

create database cmdb default charset=utf8;

8、修改配置文件config.ini(所在目录:/CMDB/app/backend/):

[db]
db_host = 127.0.0.1  
db_port = 3306
db_user = test
db_pass = test_1234
db_name = cmdb

[saltstack]
url = https://192.168.0.2:8888
user = test
pass = test_1234
[network]
device = eth0

9、数据库创建:

python manage.py syncdb
python manage.py migrate app
python manage.py makemigrations

10、安装成功启动登录:

启动步骤:
启动/web/CMDB/app/backend


nohup python salt_event_to_mysql.py &
nohup python salt_event_to_mysql.py &   **#事件监听返回日志

nohup ./manage.py runserver 0.0.0.0:8888 &
nohup python manage.py celery worker -A CMDB -l info &
nohup python manage.py celery beat --loglevel=info &

auto_cmdb's People

Contributors

blueyin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.