前言
蓝鲸云安装包下载链接
# yum install -y epel-release rsync deltarpm pssh jq
# cat << EOF >> /etc/security/limits.conf
root soft nofile 102400
root hard nofile 102400
EOF
# mv /etc/localtime /etc/localtime.bak && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# echo "umask 0022" |tee -a ~/.bashrc
# echo "nameserver 127.0.0.1" |tee -a /etc/resolv.conf
# hostnamectl set-hostname [三台名字别取一样]
# systemctl stop firewalld && systemctl disable firewalld
# sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# mkdir ~/.pip && cat << EOF > ~/.pip/pip.conf //配置pip源
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
EOF
# cat >> /etc/profile <
如果NetworkManager是停止的可以跳过这个步骤
修改服务从NetworkManager到network
# systemctl status NetworkMnager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-04-14 04:15:14 EDT; 4h 13min ago
Docs: man:NetworkManager(8)
Main PID: 784 (NetworkManager)
CGroup: /system.slice/NetworkManager.service
└─784 /usr/sbin/NetworkManager --no-daemon
# uuidgen eth0
47a68f4f-d5f4-40de-8241-33a96a2ab167
# route add -host 根据当前网卡地址 gw 根据当前网关 dev eth0
# route add -host 192.168.130.233 gw 192.168.130.254 dev eth0
# cat << EOF >/etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=自己生成新的
ONBOOT=yes
HWADDR=根据当前网卡 // ip a可以查看mac地址
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPADDR=根据当前网卡
NETMASK=255.255.255.0
GATEWAY=根据当前网卡网关
DNS1=8.8.8.8
EOF
# systemctl stop NetworkManager
# systemctl disable NetworkManager
# systemctl start network
# systemctl enable network
# reboot
# mkdir /data //下载包移动到/data下
# mv bkce_src-6.0.2.tgz /data/ && cd /data && tar xf bkce_src-6.0.2.tgz
# cd /data/src/; for f in *gz;do tar xf $f; done //解压各个产品软件包
到蓝鲸页面下载证书
ip a查看mac地址,网页上分号隔开。
52:54:00:33:06:f4;52:54:00:34:3c:de;52:54:00:0b:83:5d
把下载的证书上传到服务器的/data路径下
# install -d -m 755 /data/src/cert
# tar xf /data/ssl_certificates.tar.gz -C /data/src/cert/
# chmod 644 /data/src/cert/*
# cp -a /data/src/yum /opt //拷贝 rpm 包文件夹到/opt/目录
cat << EOF >/data/install/install.config
192.168.130.233 iam,ssm,usermgr,gse,license,redis,consul,es7,monitorv3(influxdb-proxy),monitorv3(monitor),monitorv3(grafana)
192.168.130.234 nginx,consul,mongodb,rabbitmq,appo,influxdb(bkmonitorv3),monitorv3(transfer),fta,beanstalk
192.168.130.235 paas,cmdb,job,mysql,zk(config),kafka(config),appt,consul,log(api),nodeman(nodeman)
EOF
# bash /data/install/configure_ssh_without_pass //设置免密登陆
# cd /data/install/ && ./bk_install common //执行每台服务器初始化操作(主控机操作)[[执行两次安装命令]]。安一次依赖包安不完全
# ./health_check/check_bk_controller.sh //检查相关配置,都OK即为成功
报错
Stderr: http://192.168.130.233:8080/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to 192.168.130.233:8080; No route to host"
# yum --disablerepo=bk-custom //执行这个命令
若出现
No package mysql-community-client available.
的情况手动安装or执行安装下一步paas的时候自己会下载(可管可不管)
# rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm //[参考链接:https://blog.csdn.net/u010886217/article/details/83690006]
# yum -y install mysql-community-client
# ./bk_install paas //(主控机操作)
报错
curl: (6) Could not resolve host: pass.service.consul; Unknow error"
# vi /usr/local/openresty/nginx/conf/nginx.conf //编辑nginx,在nginx那台服务器上192.168.130.234。保存后等五分钟再从新安装paas
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64; //加此行
log_format main '$remote_addr - $remote_user [$time_local] “$request” ’
'$status $body_bytes_sent “$http_referer” ’
‘"$http_user_agent" “$http_x_forwarded_for”’;
# netstat -anpt|grep uwsgi //三台服务器同时输入此命令找出是哪一台启动了此端口
tcp 0 0 192.168.130.235:8000 0.0.0.0:* LISTEN 13970/uwsgi
# vi /data/install/support-files/templates/nginx/paas.conf //(主控机上操作)
# vim:ft=sh
# upstream - web
upstream OPEN_PAAS_APPENGINE {
{
{ range service "paas-appengine" }}server {
{ .Address }}:{
{ .Port }} max_fails=1 fail_timeout=30s;
{
{else}}server 192.168.130.235:8000;{
{ end }}
}
upstream OPEN_PAAS {
{
{ range service "paas-paas" }}server {
{ .Address }}:{
{ .Port }} max_fails=1 fail_timeout=30s;
{
{else}}server 192.168.130.235:8001;{
{ end }}
}
upstream OPEN_PAAS_ESB {
{
{ range service "paas-esb" }}server {
{ .Address }}:{
{ .Port }} max_fails=1 fail_timeout=30s;
{
{else}}server 192.168.130.235:8002;{
{ end }}
}
upstream OPEN_PAAS_LOGIN {
{
{ range service "paas-login" }}server {
{ .Address }}:{
{ .Port }} max_fails=1 fail_timeout=30s;
{
{else}}server 192.168.130.235:8003;{
{ end }}
}
upstream OPEN_PAAS_CONSOLE {
{
{ range service "paas-console" }}server {
{ .Address }}:{
{ .Port }} max_fails=1 fail_timeout=30s;
{
{else}}server 192.168.130.235:8004;{
{ end }}
}
upstream OPEN_PAAS_APIGW {
{
{ range service "paas-apigw" }}server {
{ .Address }}:{
{ .Port }} max_fails=1 fail_timeout=30s;
{
{else}}server 192.168.130.235:8005;{
{ end }}
}
# vi /etc/consul-template/templates/nginx.conf
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64; //加此行
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# ./bkcli stop paas
# ./bkcli restart nginx
# ./bkcli start paas
# ./bk_install app_mgr //(主控机操作)
# ./bk_install cmdb //(主控机操作)
# ./bk_install job //(主控机操作)
报错
# ./bkcli restart bkiam //iam启动失败,执行如下命令
# ./bkcli check bkiam
# ./bkcli initdata cmdb
/data/install/health_check/check_cmdb_blueking_id
其他命令
# ./bkcli status job //查看job的状态
# pcmd -m job systemctl start bk-job-crontab.service //重新启动job的各个进程
# pcmd -m job systemctl status bk-job-crontab.service
数据库连接
# mysql --login-path=default-root //登陆方式在192.168.130.235登陆
> show variables like’%time_zone’;
# ./bk_install bknodeman //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# vi /usr/local/openresty/nginx/conf/nginx.conf //编辑nginx,在nginx的nginx服务器上192.168.130.234。保存后等五分钟再从新安装paas
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64; //加此行
log_format main '$remote_addr - $remote_user [$time_local] “$request” ’
'$status $body_bytes_sent “$http_referer” ’
‘"$http_user_agent" “$http_x_forwarded_for”’;
# ./bkcli restart nginx //重启
下面介绍的操作均可能覆盖现有 hosts ,进行操作前请先确认是否需要备份。
Windows 配置 用文本编辑器(如Notepad++)打开文件: C:\Windows\System32\drivers\etc\hosts将以下内容复制到上述文件内,并将以下 IP 需更换为PCwindows可以访问的 IP,然后保存。
192.168.130.234 paas.bktencent.com cmdb.bktencent.com job.bktencent.com jobapi.bktencent.com
192.168.130.235 nodeman.bktencent.com
192.168.130.234 paas.bktencent.com cmdb.bktencent.com job.bktencent.com jobapi.bktencent.com
192.168.130.235 nodeman.bktencent.com
登陆paas,浏览器上输入域名
paas.bktencent.com
在任意一台机器上,执行以下命令,获取管理员账号和密码。
# grep -E "BK_PAAS_ADMIN_USERNAME|BK_PAAS_ADMIN_PASSWORD" /data/install/bin/04-final/usermgr.env
BK_PAAS_ADMIN_PASSWORD=cF2VRrktGmAW
BK_PAAS_ADMIN_USERNAME=admin
点击开发者中心
输入rabbitmq.service.consul 到地址里,在任意一台机器上,执行以下命令,获取管理员账号和密码。
# grep RABBITMQ /data/install/bin/01-generate/dbadmin.env
BK_RABBITMQ_ERLANG_COOKIES=Qk9JT3lnSW1HMA==
BK_RABBITMQ_ADMIN_PASSWORD=fgkUzy2SuntX
BK_RABBITMQ_ADMIN_USER=admin
# ./bk_install bkmonitorv3 //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install bklog //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install fta //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install saas-o bk_iam //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install saas-o bk_user_manage //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install saas-o bk_sops //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install saas-o bk_itsm //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart yum
# ./bk_install saas-o bk_fta_solutions //(主控机操作)
报错如果安装bknodeman出现
deploy failed: timeout
重启# ./bkcli restart cmdb
# ./bkcli initdata topo //(主控机操作)
如果没有报错,则成功
如果运行topo出现错误
到中控机运行下/usr/local/openresty/nginx/sbin/nginx -t 是否有报错,如果报错更具相关报错百度修改下。或到https://bk.tencent.com/s-mart/community/question/1545
# source ~/.bashrc //(主控机操作)
# cd /data/install/ //(主控机操作)
# echo bkssm bkiam usermgr paas cmdb gse job consul bklog | xargs -n 1 ./bkcli check
都是[SUCCESS]则安装完成
# cat /data/install/bin/01-generate/gse.env
BK_GSE_ZK_AUTH=zkuser:k71ySbAYRvOJ
# cat /data/bkce/bknodeman/nodeman/bin/environ.sh
#!/bin/sh
# 节点管理公网回调地址
if [ "" == "" ]; then
bkapp_nodeman_outer_callback_url="http://192.168.130.235:80/backend"
# bkapp_nodeman_outer_callback_url="http:///backend"
else
bkapp_nodeman_outer_callback_url=""
fi
# 节点管理内网回调地址
if [ "" == "" ]; then
bkapp_nodeman_callback_url="http://192.168.130.235:10300/backend"
else
bkapp_nodeman_callback_url=""
fi
# ./bkcli restart nodeman //(主控机)修改后重启
安装云区域服务器如果下载太慢可以通过修改安装脚本从本机引用安装包。
先到已经安装好了云区域服务器进入/tmp 目录
把gse_proxy-linux-x86_64.tgz 发送到另一台服务器上/root/下