藍鯨平臺5.1.29社群版單機部署
阿新 • • 發佈:2021-12-16
一.環境
機器:阿里雲ECS
配置:4c8g一臺
系統:centos7.3
IP:10.0.12.22
其它:要可以聯網,正常使用yum源
二.部署
1.環境準備,執行初始化指令碼
#!/bin/bash check_network() { #檢查外網 curl -I www.baidu.com &> /dev/null if [[ $? -ne 0 ]];then echo "network error" exit 1 fi } set_selinux() { #關閉selinux和firewalld sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/selinux/config sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config } set_firewalld() { #關閉防火牆 systemctl stop firewalld systemctl disable firewalld } set_limit() { #更改檔案描述符 sed -i '/^root soft nofile/ d' /etc/security/limits.conf sed -i '/^root hard nofile/ d' /etc/security/limits.conf sed -i '/^* soft nofile/ d' /etc/security/limits.conf sed -i '/^* hard nofile/ d' /etc/security/limits.conf echo 'root soft nofile 102400 root hard nofile 102400 * soft nofile 102400 * hard nofile 102400' >> /etc/security/limits.conf } set_sys() { #核心檔案替換 echo 'net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv4.neigh.default.gc_stale_time=120 net.ipv4.conf.default.arp_announce = 2 net.ipv4.conf.all.arp_announce=2 net.ipv4.conf.lo.arp_announce=2 net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.icmp_ignore_bogus_error_responses = 1 net.ipv4.ip_forward = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0 net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 net.ipv4.tcp_max_tw_buckets = 6000 net.ipv4.tcp_sack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.core.netdev_max_backlog = 262144 net.ipv4.tcp_max_orphans = 3276800 net.ipv4.tcp_max_syn_backlog = 262144 net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_syn_retries = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 94500000 915000000 927000000 net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_keepalive_time = 1800 net.ipv4.tcp_keepalive_probes = 3 net.ipv4.tcp_keepalive_intvl = 15 net.ipv4.ip_local_port_range = 1024 65535 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 vm.swappiness = 10 kernel.panic = 5 fs.file-max = 1048576 net.ipv4.tcp_congestion_control = hybla vm.overcommit_memory = 1 vm.dirty_ratio = 1 vm.swappiness = 10 vm.vfs_cache_pressure = 110 vm.dirty_background_ratio = 1 vm.dirty_writeback_centisecs = 100 vm.dirty_expire_centisecs = 100' > /etc/sysctl.conf sysctl -p } set_yum() { #yum包 rm -rf /etc/yum.repos.d/epel.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo yum clean all yum makecache yum -y install rsync gcc lrzsz } set_network() { #關閉網路,但對於dhcp服務,可能重啟後進行變動,所以要繫結靜態IP。雲服務不用,DHCP是穩定的。 systemctl stop NetworkManager systemctl disable NetworkManager } set_dns() { #修改nds為內部 sed -i '1 i nameserver 127.0.0.1' /etc/resolv.conf chattr +i /etc/resolv.conf } #########使用設定######### #開始 check_network set_selinux set_firewalld set_limit set_sys set_yum set_network set_dns
2.下載安裝包
mkdir /data
cd /data
wget https://bkopen-1252002024.file.myqcloud.com/ce/38f7796/bkce_src-5.1.29.tar.gz
tar -xf bkce_src-5.1.29.tar.gz
解壓之後,得到兩個目錄:src,install
src:存放藍鯨產品軟體,以及依賴的開源元件
install:存放安裝部署指令碼、安裝時的引數配置、日常運維指令碼
3.其它檔案
globals.env
該檔案定義了各類元件的賬號密碼資訊, 通常情況下只需要修改各個模組或者元件的密碼就可以, 訪問域名可以自己定義。內網可以修改本機hosts來訪問,這裡只允許域名不能通過IP訪問
ports.env
埠定義。預設情況下,不用修改。特殊場景下,若有埠衝突,可以自行定義。
4.獲取機器的 MAC 地址生成證書,下載 證書檔案 上傳至中控機並解壓到 src/cert 目錄下。
install -d -m 755 /data/src/cert
tar xf ssl_certificates.tar.gz -C /data/src/cert
5.部署檢查
cd /data/install
./install_minibk
6.依次安裝如下,看是否報錯
./bk_install paas ./bk_install cmdb ./bk_install job ./bk_install app_mgr ./bk_install fta ./bk_install saas-o
7.啟動後用paas.bk.com,admin登陸,密碼統一為el3ZQgIN7r