BigOps CMDB资产管理系统部署笔记

释放双眼,带上耳机,听听看~!

准备环境

1)硬件配置
建议物理内存8G+、CPU 4 cores+、硬盘20G+

2)操作系统
1台全新操作系统主机,理论上支持所有Linux操作系统,建议使用:

  • CentOS 6 x86 64位
  • CentOS 7 x86 64位 (推荐)

3)服务对应端口

服务 端口
统一认证 30000、30001
work后端 30002、30003
预留 30004、30005
dv后端 30006、30007
confluence 30008、30009
jira 30010、30011
jenkins 30012、30013
kibana 5601
cerebro 9000
elasticsearch-head 9100
elasticsearch 9200、9300

4)域名
两个域名
sso.xxxx.com,用于统一认证
work.xxxx.com,用于主站
如果没有注册域名,需要给服务器和笔记本都配置hosts。

Linux位置/etc/hosts。
Windows位置C:\Windows\System32\drivers\etc\hosts,如果不能直接编辑,可以先拷贝到桌面,编辑完在拷贝回原位置。

5)能够解析自己的主机名

设置主机名
hostnamectl set-hostname abcops_cmdb01

添加解析
echo '127.0.0.1 abcops_cmdb01' >> /etc/hosts
echo '192.168.31.225 abcops_cmdb01' >> /etc/hosts
ping abcops_cmdb01

6)初始化环境

cd ~
wget -O centos_init_env.sh https://raw.githubusercontent.com/yunweibang/bigops-install/master/centos_init_env.sh
sh centos_init_env.sh

初始化环境完成截图:

7)关闭IPv6
centos 7

编辑/etc/default/grub,在GRUB_CMDLINE_LINUX的值里添加ipv6.disable=1,例如:
GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto rhgb quiet idle=halt biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8 noibrs"

再运行命令
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot

centos6

cat <<EOF>>/etc/modprobe.d/disable_ipv6.conf
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
EOF

echo 'alias ipv6 off' >/etc/modprobe.d/ipv6.conf
sed -i '/NETWORKING_IPV6.*/d' /etc/sysconfig/network
echo 'NETWORKING_IPV6=no' >> /etc/sysconfig/network
service ip6tables stop
chkconfig ip6tables off

8)下载安装包

百度网盘
地址:https://pan.baidu.com/s/1y8JyQJIUWnzDiH0fX2EpcQ
密码:76cm

安装MySQL

脚本安装MySQL 8.0

wget -O mysql80.sh https://raw.githubusercontent.com/yunweibang/bigops-install/master/mysql80.sh
sh mysql80.sh

Confirm delete database datadir: /var/lib/mysql/ , (y/n)?
>y

----------------------------------
press any key to continue       按任意键继续

----------------------------------
看到下面提示,输入root@127.0.0.1用户密码,保存好一会使用。另外root@localhost密码为空
please input root@127.0.0.1 password, default bigops  输入你的密码
>123456

----------------------------------
Installed successfully, root@127.0.0.1 password is 123456
please running command testing: mysq

优化MySQL,修改/etc/my.cnf里innodb_buffer_pool_size的值,用命令计算:
说明:BigOps系统占用4G,所以innodb_buffer_pool_size等于总内存减去4G后的70%到80%

[root@abcops_cmdb01 src]# free -g|egrep -i ^mem|awk '{if($2<7) print "memory is too small";else print int(($2-4)*0.8)"G"}'
2G

比如上面命令返回8G,就这样设置:

[root@abcops_cmdb01 src]# vim /etc/my.cnf
innodb_buffer_pool_size=2G

修改完后需要重启MySQL

[root@abcops_cmdb01 src]# systemctl restart mysqld

安装 BigOps

[root@abcops_cmdb01 src]# tar xf bigops-1.0.3.tar.gz 
[root@abcops_cmdb01 src]# chmod +x bigops-1.0.3/install/install.sh 
[root@abcops_cmdb01 src]# ./bigops-1.0.3/install/install.sh

please input sso url, default sso.bigops.com    
>sso.abcops.com     输入sso url域名
please input home url, default work.bigops.com
>work.abcops.com    输入work  url域名
please input db host, default 127.0.0.1
>127.0.0.1          输入数据库地址,不要输localhost
please input db port, default 3306
>3306               输入数据库端口
please input db name, default bigops
>bigops             输入数据库库名
please input db user, default root
>root               输入数据库用户
please input db pass
>123456             输入数据库用户密码

----------------------------------          数据库连接方式
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/bigops?useSSL=false&useUnicode=true&autoReconnect=true&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=123456

----------------------------------
Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the 'bigops' database [y/N] y    删除已存在的数据库
installation failed.code 1 exit

----------------------------------
test command
mysql -uroot -p123456 -h127.0.0.1 -P3306                    测试命令,用于排错

BigOps系统会被安装到/opt/bigops目录

安装完后检测

1)检查服务端口是否启动

[root@abcops_cmdb01 /]# netstat -nptl|egrep 3000
tcp        0      0 127.0.0.1:30000         0.0.0.0:*               LISTEN      3430/java           
tcp        0      0 127.0.0.1:30001         0.0.0.0:*               LISTEN      3430/java           
tcp        0      0 127.0.0.1:30002         0.0.0.0:*               LISTEN      3455/java           
tcp        0      0 127.0.0.1:30003         0.0.0.0:*               LISTEN      3455/java

2)检查Nginx状态

[root@abcops_cmdb01 /]# ps aux|grep nginx.conf
root     12492  0.0  0.0 112712   980 pts/1    S+   12:07   0:00 grep --color=auto nginx.conf
root     32342  0.0  0.0  46600  1280 ?        Ss   11:51   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

3)检测Nginx域名配置是否正确

[root@abcops_cmdb01 /]# grep -Ev "#|^$"  /etc/nginx/conf.d/sso.conf | grep server_name
    server_name sso.abcops.com;
[root@abcops_cmdb01 /]# grep -Ev "#|^$"  /etc/nginx/conf.d/work.conf | grep server_name   
    server_name work.abcops.com;

4)本机添加hosts解析

[root@abcops_cmdb01 /]# tail -2 /etc/hosts
192.168.31.225 sso.abcops.com
192.168.31.225 work.abcops.com

要访问站点的主机都要添加hosts解析

5)添加DNS解析指向本机

[root@abcops_cmdb01 /]# cat /etc/resolv.conf
nameserver 127.0.0.1
nameserver 114.114.114.114
nameserver 8.8.8.8

6)重启Nginx

[root@abcops_cmdb01 /]# systemctl restart nginx

测试访问

登录系统
访问域名:http://work.abcops.com (就是你刚才设置的home url)
默认账号:admin
默认密码:bigops
登陆后请尽快修改密码

人已赞赏
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧