CMDB的GitHub地址:

https://github.com/open-cmdb/cmdb

环境说明

[root@WCY ~]# cat /etc/redhat-release
CentOS Linux release 7.5. (Core)
[root@WCY ~]# uname -a
Linux WCY 3.10.-862.3..el7.x86_64 # SMP Fri Jun :: UTC x86_64 x86_64 x86_64 GNU/Linux

安装Java

ES依赖Java

查看下Java-openjdk的包:

安装

[root@WCY ~]# yum -y install java-1.8.-openjdk-devel.x86_64

完成后查看下版本检查是否安装成功

[root@WCY ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK -Bit Server VM (build 25.191-b12, mixed mode)

安装ES

下载ES安装包

https://www.elastic.co/downloads/past-releases/elasticsearch-5-6-8

安装

[root@WCY ~]# tar xf elasticsearch-5.6..tar.gz
[root@WCY ~]# mv elasticsearch-5.6. /usr/local/elasticsearch
[root@WCY ~]# cd /usr/local/
[root@WCY local]# useradd es //用root用户启动会报错
[root@WCY local]# chown -R es:es elasticsearch/
[root@WCY local]# vim elasticsearch/config/elasticsearch.yml network.host: 192.168.233.20
#
# Set a custom port for HTTP:
#
http.port: [root@WCY ~]# su es
[root@WCY ~]# cd /usr/local/elasticsearch/bin/
[es@WCY bin]$ ./elasticsearch -d
[es@WCY bin]$ exit
exit
[root@WCY ~]# netstat -anpt | grep :
tcp6 192.168.233.20: :::* LISTEN /java

启动ES时如过报错如下:

[--06T22::,][INFO ][o.e.b.BootstrapChecks ] [85c-JtA] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [] bootstrap checks failed
[]: max virtual memory areas vm.max_map_count [] is too low, increase to at least []

解决

修改以下文件

切换至root用户操作:

[root@WCY ~]# tail - /etc/security/limits.conf
# End of file
* soft nofile
* hard nofile
* soft nproc
* hard nproc [root@WCY ~]# tail - /etc/security/limits.d/-nproc.conf
* soft nproc
root soft nproc unlimited [root@WCY ~]# tail - /etc/sysctl.conf
vm.max_map_count=
[root@WCY ~]# sysctl -p 操作完成后,切换至es用户重新启动ES

测试ES

[root@Elements ~]# curl -X GET http://192.168.233.20:9200
{
"name" : "85c-JtA",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "cefcfJG8QKCPT5qTLU_Phg",
"version" : {
"number" : "5.6.8",
"build_hash" : "688ecce",
"build_date" : "2018-02-16T16:46:30.010Z",
"build_snapshot" : false,
"lucene_version" : "6.6.1"
},
"tagline" : "You Know, for Search"
}

查看本机IP方法

ip a | grep "scope global" | awk -F'[ /]+' '{print $3}' | head -

安装MySQL

下载安装MySQL5.6的yum源

//yum有时候网络不好可能安装不上,可以手动安装

https://www.cnblogs.com/LuckWJL/p/9683683.html

[root@WCY ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[root@WCY ~]# rpm -ivh mysql-community-release-el7-.noarch.rpm

安装配置启动MySQL

[root@WCY ~]# yum -y install mysql-server
[root@WCY ~]# vim /etc/my.cnf
[mysqld]
innodb_file_per_table
[root@WCY ~]# systemctl enable mysqld
[root@WCY ~]# systemctl start mysqld

初始化数据库

[root@WCY ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. Enter current password for root (enter for none):
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation. Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment. Remove anonymous users? [Y/n] y
... Success! Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y
... Success! By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment. Remove test database and access to it? [Y/n] y
- Dropping test database...
ERROR (HY000) at line : Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success! Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] y
... Success! All done! If you've completed all of the above steps, your MySQL
installation should now be secure. Thanks for using MySQL! Cleaning up...

创建数据库并授权用户

[root@WCY ~]# mysql -uroot -p
Enter password: mysql> create database cmdb;
Query OK, row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON cmdb.* TO 'cmdb'@'%' IDENTIFIED BY '' WITH GRANT OPTION; //建议自定义修改密码
Query OK, rows affected (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec)

安装Docker

[root@WCY ~]# yum -y install docker-io

开启IPV4转发功能

[root@WCY ~]# echo "net.ipv4.ip_forward=1" >> /usr/lib/sysctl.d/-system.conf
[root@WCY ~]# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
[root@WCY ~]# sysctl -p

启动docker

[root@WCY ~]# systemctl enable docker.service
[root@WCY ~]# systemctl start docker.service

初始化CMDB

docker run -it --name cmdb-init-db --rm -e DB_HOST=数据库地址 -e ENV=PRO -e DB_PORT=数据库端口 -e DB_USERNAME=数据库用户名 -e DB_PASSWORD=数据库密码 -e DB_NAME=cmdb mingmingtang/cmdb init-db

示例

docker run -it --name cmdb-init-db --rm -e DB_HOST=192.168.233.20 -e ENV=PRO -e DB_PORT= -e DB_USERNAME=cmdb -e DB_PASSWORD= -e DB_NAME=cmdb mingmingtang/cmdb init-db

运行CMDB

docker run -d --name cmdb -p : -e ENV=PRO -e SITE_URL=网站地址 -e DB_HOST=数据库地址 -e DB_PORT=数据库端口 -e DB_USERNAME=数据库用户名 -e DB_PASSWORD=数据库密码 -e DB_NAME=cmdb -e ELASTICSEARCH_HOSTS=ES地址,多个用英文逗号隔开,格式http://xx.xx.xx.xx:9200 -e EMAIL_HOST=邮箱smtp地址 -e EMAIL_PORT=邮箱smtp端口 -e EMAIL_USERNAME=发件箱 -e EMAIL_PASSWORD=邮箱密码 mingmingtang/cmdb start

示例

docker run -d --name cmdb -p : -e ENV=PRO -e SITE_URL=http://192.168.233.20 -e DB_HOST=192.168.233.20 -e DB_PORT=3306 -e DB_USERNAME=cmdb -e DB_PASSWORD=123123 -e DB_NAME=cmdb -e ELASTICSEARCH_HOSTS=http://192.168.233.20:9200 -e EMAIL_HOST=smtp.exmail.qq.com -e EMAIL_PORT=587 -e EMAIL_USERNAME=wangjinlong@elements.org.cn -e EMAIL_PASSWORD=Long963. mingmingtang/cmdb start

温馨提示:检查防火墙时候开放所需端口

访问CMDB

浏览器输入URL进行访问:

http://IP

例如:http://192.168.233.20

初始用户名:admin

初始密码:cmdbcmdb

开源CMDB详细安装使用的更多相关文章

  1. 图解MySQL5.5详细安装与配置过程

    MySQL是一个开源的关系型数据库管理系统,原由瑞典MySQL AB公司开发,目前属于Oracle公司旗下.MySQL是目前世界上开源数据库中最受欢迎的产品之一,是应用最为广泛的开源数据库.MySQL ...

  2. Step by Step 真正从零开始,TensorFlow详细安装入门图文教程!帮你完成那个最难的从0到1

    摘要: Step by Step 真正从零开始,TensorFlow详细安装入门图文教程!帮你完成那个最难的从0到1 安装遇到问题请文末留言. 悦动智能公众号:aibbtcom AI这个概念好像突然就 ...

  3. 【转】Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置

    Syncthing – 数据同步利器---自己的网盘,详细安装配置指南,内网使用,发现服务器配置 原贴:https://www.cnblogs.com/jackadam/p/8568833.html ...

  4. Linux rhel7 下MySQL5.7.18详细安装文档

    Linux rhel7 下MySQL5.7.18详细安装文档 本文安装MySQL5.7使用的是vm虚拟机rhel7操作系统 ,ftp文件传输是FileZilla3.27,远程连接xssh5.0 1 登 ...

  5. Linux下zookeeper单机版详细安装

    Linux下zookeeper单机版详细安装 1.zookeeper简介 ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop ...

  6. linkedin开源的kafka-monitor安装文档

    linkedin开源的kafka-monitor安装文档 linkedin 开源的kafka-monitor的安装使用可以参考官方的readme:流程介绍的已经比较清楚,但是还是有一些地方需要修正.让 ...

  7. Lamp环境的详细安装教程

    原文:Lamp环境的详细安装教程 架构LAMP环境 1.布置LAMP环境之前的准备工作 在架构LAMP环境时,确保你的Linux系统已经安装了make.gcc.gcc-c++(使用rpm -q xxx ...

  8. 基于LNMP的Zabbbix之Zabbix Agent源码详细安装,但不给图

    基于LNMP的Zabbbix之Zabbix Server源码详细安装:http://www.cnblogs.com/losbyday/p/5828547.html wget http://jaist. ...

  9. Jenkins:VMware虚拟机Linux系统的详细安装和使用教程

    jenkins:VMware虚拟机Linux系统的详细安装和使用教程 (一) 不是windows安装虚拟机可跳过 1.Windows安装VMware 2.VMware安装linux系统 3.windo ...

随机推荐

  1. 在UI线程之外,多线程处理Bitmaps

    多线程处理Bitmaps     上一篇,我们讨论了:Android有效的处理Bitmap,降低内存 ,可是最好不要运行在主线程(UI线程),假设图片是本地的或者网络的又或者是其它地方的. 图片载入的 ...

  2. jupyter 修改工作路径

    在所需打开的目录中新建一个runJupyter.bat文件 将内容修改为: cd ......jupyter notebook 注1:上述两行中,第一行的......为路径(可以不添加,可空着不填), ...

  3. 170303、PHP微信公众平台开发接口 SDK完整版

    <?php /* 方倍工作室 http://www.fangbei.org/ CopyRight 2015 All Rights Reserved */ define("TOKEN&q ...

  4. decode-encode --其他使用可能有问题

    SELECT id,DECODE(name,'password') FROM test UPDATE test SET `name`=ENCODE(`name`,'password')

  5. WebBench----简洁优美的网站压力测试工具

    [root@c webbench]# webbench -c 10 -t 20 http://www.baidu.com/Webbench - Simple Web Benchmark 1.5Copy ...

  6. 编译型 解释型 C++工作原理

    C++教程_w3cschool https://www.w3cschool.cn/cpp/ C++工作原理: C++语言的程序因为要体现高性能,所以都是编译型的.但其开发环境,为了方便测试,将调试环境 ...

  7. 使用Docker创建Elasticsearch服务

    一.Docker是什么? Docker是一个开源工具,能将一个WEB应用封装在一个轻量级,便携且独立的容器里,然后可以运行在几乎任何服务环境下.Docker的容器能使应用跑在任何服务器上并且表现一致. ...

  8. 解决 apt-get the following packages has unmet dependencies 问题

    安装vpn遇到以下问题: 显示flinux print util和openconnect存在依赖库的冲突 此时尝试安装新的tk.vpnc-scripts.libopenconnect5,尝试apt-g ...

  9. Angular学习笔记—Rxjs、Promise的区别

    Promises: 异步操作完成或失败时处理单个事件 不可取消 代码可读性强,有try/catch Observables: 可持续监听和响应多个事件 可取消订阅 支持map, filter, red ...

  10. keras中 LSTM 的 [samples, time_steps, features] 最终解释

    I am going through the following blog on LSTM neural network:http://machinelearningmastery.com/under ...