一. 藍鯨6.02部署文檔
1. 服務器與物料准備
准備物料:
藍鯨6.02部署包:
https://bkopen-1252002024.file.myqcloud.com/ce/bkce_src-6.0.2.tgz
#前提條件:
#服務器3台:
192.168.1.161
192.168.1.162
192.168.1.163
#配置主機名:
192.168.1.161 node-1 #[假設該機為中控機,中控機必須有訪問公網的能力]
192.168.1.162 node-2
192.168.1.163 node-3
#文件描述符修改[所有服務器]:
sed -i 's#^SELINUX=.*#SELINUX=disabled#' /etc/selinux/config
cat << EOF >> /etc/security/limits.conf
root soft nofile 102400
root hard nofile 102400
EOF
echo 'ulimit -SHn 65536' >>/etc/profile
source /etc/profile
#關閉防火牆
systemctl stop firewalld # 停止 firewalld
systemctl disable firewalld # 禁用 firewall 開機啟動
#安裝rsync ntpdate
yum -y install rsync ntpdate
ntpdate cn.pool.ntp.org
#修改網卡管理方式
systemctl stop NetworkManager
systemctl disable NetworkManager
#准備證書:
#下載證書[三台服務器mac,或gse服務器的mac]
1. 服務器 cat /sys/class/net/eth0/address 獲取mac地址
2. https://bk.tencent.com/download_ssl/ 粘貼mac地址多個mac用;隔開 下載證書
#准備swap:
#服務器要求配置較高,如果現有機器配置不夠可以划分swap分區分擔內存壓力:
#[三台都添加10G swap]
dd if=/dev/zero of=/swapfile bs=1M count=10240
mkswap /swapfile
swapon /swapfile
echo 80 > /proc/sys/vm/swappiness
free -m
#[中控機操作] 物料包解壓:
cd /root
mkdir -p /data
tar xf bkce_src-6.0.2.tgz -C /data
cd /data/src/; for f in *gz;do tar xf $f; done
#自定義域名:
cd /data/install
./configure -d wh02.com
#自定義密碼:
cat > /data/install/bin/03-userdef/usermgr.env << EOF
BK_PAAS_ADMIN_PASSWORD=admin
EOF
#解壓證書包:
cd /root
mkdir -p /data/src/cert
install -d -m 755 /data/src/cert
tar xf /root/ssl_certificates.tar.gz -C /data/src/cert/
chmod 644 /data/src/cert/*
#拷貝 rpm 包文件夾到/opt/目錄:
cp -a /data/src/yum /opt
#生成自定義安裝配置:
#注意:nginx組件必須處於公網服務器中
cat << EOF >/data/install/install.config
192.168.1.161 nginx,iam,ssm,usermgr,gse,license,redis,consul,es7,monitorv3(influxdb-proxy),monitorv3(monitor),monitorv3(grafana)
192.168.1.162 consul,mongodb,rabbitmq,appo,influxdb(bkmonitorv3),monitorv3(transfer),fta,beanstalk
192.168.1.163 paas,cmdb,job,mysql,zk(config),kafka(config),appt,consul,log(api),nodeman(nodeman)
EOF
# 配置免密:
bash /data/install/configure_ssh_without_pass
- 開始部署
2.1 初始化操作:
cd /data/install/
./bk_install common
2.2 檢查相關配置:
./health_check/check_bk_controller.sh
2.3 部署 PaaS:
./bk_install paas
2.4 部署 app_mgr(SaaS 運行環境)
./bk_install app_mgr
2.5 部署 CMDB(配置平台)
./bk_install cmdb
2.6 部署 JOB(作業平台)
./bk_install job
2.7 部署 bknodeman(節點管理)
./bk_install bknodeman
2.8 部署 bkmonitorv3 (監控平台)
./bk_install bkmonitorv3
2.9 部署 bklog(日志平台)
./bk_install bklog
2.10 部署 fta(故障自愈后台)
./bk_install fta
2.11 部署saas
# 權限中心
./bk_install saas-o bk_iam
# 用戶管理
./bk_install saas-o bk_user_manage
# 標准運維
./bk_install saas-o bk_sops
# 服務流程管理
./bk_install saas-o bk_itsm
# 故障自愈SaaS
./bk_install saas-o bk_fta_solutions
3. 初始化藍鯨業務拓撲
./bkcli initdata topo
5. 加載藍鯨相關維護命令
source ~/.bashrc
6. 檢測相關服務狀態
cd /data/install/
echo bkssm bkiam usermgr paas cmdb gse job consul bklog | xargs -n 1 ./bkcli check
預期正確結果:
[root@node1 install]# echo bkssm bkiam usermgr paas cmdb gse job consul bklog | xargs -n 1 ./bkcli check
[1] 14:33:01 [SUCCESS] 192.168.1.161
bkssm(http://192.168.1.161:5000/healthz) : true
[1] 14:33:01 [SUCCESS] 192.168.1.161
bkiam(http://192.168.1.161:5001/healthz) : true
[1] 14:33:02 [SUCCESS] 192.168.1.161
usermgr(http://192.168.1.161:8009/healthz/) : true
[1] 14:33:03 [SUCCESS] 192.168.1.163
paas-apigw(http://192.168.1.163:8005/api/healthz/): true
paas-appengine(http://192.168.1.163:8000/v1/healthz/): true
paas-esb(http://192.168.1.163:8002/healthz/) : true
paas-login(http://192.168.1.163:8003/healthz/): true
paas-paas(http://192.168.1.163:8001/healthz/): true
[1] 14:33:04 [SUCCESS] 192.168.1.163
cmdb-admin(http://192.168.1.163:9000/healthz): true
cmdb-api(http://192.168.1.163:9001/healthz) : true
cmdb-auth(http://192.168.1.163:9002/healthz) : true
cmdb-cloud(http://192.168.1.163:9003/healthz): true
cmdb-core(http://192.168.1.163:9004/healthz) : true
cmdb-datacollection(http://192.168.1.163:9005/healthz): true
cmdb-event(http://192.168.1.163:9006/healthz): true
cmdb-host(http://192.168.1.163:9007/healthz) : true
cmdb-operation(http://192.168.1.163:9008/healthz): true
cmdb-proc(http://192.168.1.163:9009/healthz) : true
cmdb-task(http://192.168.1.163:9011/healthz) : true
cmdb-topo(http://192.168.1.163:9012/healthz) : true
cmdb-web(http://192.168.1.163:9013/healthz) : true
[1] 14:33:29 [SUCCESS] 192.168.1.161
bk-gse-alarm : running
bk-gse-api : running
bk-gse-btsvr : running
bk-gse-data : running
bk-gse-dba : running
bk-gse-procmgr : running
bk-gse-syncdata: running
bk-gse-task : running
check job backend health
[1] 14:33:29 [SUCCESS] 192.168.1.163
job-execute : true
job-backup : true
job-logsvr : true
job-crontab : true
job-config : true
job-gateway-management: true
job-manage : true
check job frontend resource
[1] 14:33:30 [SUCCESS] 192.168.1.161
-rw-r--r-- 1 blueking blueking 1260 Mar 8 13:38 /data/bkce/job/frontend/index.html
[1] 14:33:30 [SUCCESS] 192.168.1.161
check_consul_process [OK]
check_consul_listen_udp_53 [OK]
check_consul_listen_tcp_8500 [OK]
check_consul_warning_svc [OK]
check_consul_critical_svc [OK]
check_resolv_conf_127.0.0.1 [OK]
[2] 14:33:30 [SUCCESS] 192.168.1.163
check_consul_process [OK]
check_consul_listen_udp_53 [OK]
check_consul_listen_tcp_8500 [OK]
check_consul_warning_svc [OK]
check_consul_critical_svc [OK]
check_resolv_conf_127.0.0.1 [OK]
[3] 14:33:30 [SUCCESS] 192.168.1.162
check_consul_process [OK]
check_consul_listen_udp_53 [OK]
check_consul_listen_tcp_8500 [OK]
check_consul_warning_svc [OK]
check_consul_critical_svc [OK]
check_resolv_conf_127.0.0.1 [OK]
[1] 14:33:31 [SUCCESS] 192.168.1.163
bklog-api(http://192.168.1.163:10400/healthz/): true
3.訪問藍鯨
windows下訪問藍鯨配置:
編輯文件: C:\Windows\System32\drivers\etc\hosts
192.168.1.161 cmdb.wh02.com paas.wh02.com job.wh02.com jobapi.wh02.com nodeman.wh02.com
4.安裝agent
在首頁中進入節點管理安裝agent:



5.組件檢查

cd /data/install
echo bkssm bkiam usermgr paas cmdb gse job consul bklog | xargs -n 1 ./bkcli check
二. 自動化部署腳本
1.腳本列表
config.ini
install_bk.sh
os_init.sh
uninstall.sh
bkinst_control.sh
下載地址:
鏈接:https://pan.baidu.com/s/1r0yIcfuKVwDNIsh4i3981w
提取碼:1234
2.使用方法
cat config.ini
#-------------------------------------------------------#
# 定義安裝目錄
install_directory=/data
# 配置安裝藍鯨社區版節點列表
nodeList="172.16.1.21 172.16.1.22 172.16.1.23"
# 配置nginx所在的節點IP,如果需要公網訪問藍鯨那么nginx配置在公網可以訪問的節點上
# 配置為空,nginx默認是在第二台上
nodeNG="172.16.1.21"
# 配置安裝藍鯨社區版節點密碼,密碼需要一致
nodePassword="Bigdata666"
# 指定藍鯨訪問域名,參數為空默認域名bktencent.com(BK_DOMAIN與INSTALL_PATH並存)
BK_DOMAIN="bktencent.com"
# 指定藍鯨安裝目錄,參數為空默認安裝目錄/data/bkce(BK_DOMAIN與INSTALL_PATH並存)
INSTALL_PATH="/data/bkce"
# 指定藍鯨平台登錄密碼,該參數為空則密碼跟節點密碼一致
BK_PAAS_PASSWORD="Bkty111313"
#-------------------------------------------------------#
config.ini配置相應的 安裝目錄 節點IP 域名信息 密碼 等.
配置完成config.ini后直接運行:
sh -x bkinst_control.sh
