前言
話不多說~直接開干
本文部署的是標(biāo)準(zhǔn)版轨功,即部署在三臺機器上旭斥,且機房是無法連接外網(wǎng)的,資源全部配置為離線資源
1.環(huán)境準(zhǔn)備
官方文檔
感覺官方文檔有些地方說的比較模糊夯辖,無法直接按照文檔操作琉预,本文羅列了讓我疑惑的點以及解決方式
三臺機器均需要做一遍配置
1.1配置離線yum源且源包含EPEL
官方文檔中提供的鏡像文件包含安裝所需的所有軟件,選擇高版本的下載即可(低版本系統(tǒng)可以用高版本的源)蒿褂,且yum源圆米、epel源用一個即可
官方y(tǒng)um源鏡像文件,下載鏈接在最底部
- yum源配置
配置離線yum源
上面的文章是通過ftp的方式配置yum源啄栓,鏡像文件使用官方給的 - EPEL配置
EPEL
就是額外的安裝包娄帖,英語不好難死中青年
EPEL需要安裝,原系統(tǒng)是沒有的昙楚,文件名為epel-release-7-12.noarch.rpm
下載地址:https://centos.pkgs.org/從這里面直接搜索下載即可
上傳到服務(wù)器近速,執(zhí)行安裝命令rpm -ivh epel-release-7-12.noarch.rpm
切換到配置目錄cd /etc/yum.repos.d/
編輯EPEL配置文件vi epel.rpo
,將文件的內(nèi)容替換即刪除掉原來的內(nèi)容
[epel]
name=epelFtp
//此處即ftp的地址
baseurl=ftp://10.0.5.48/pub
enabled=1
gpgcheck=0
修改完成后記得,更新下緩存削葱,執(zhí)行以下命令
yum clean all
yum makecache
1.2CentOS系統(tǒng)設(shè)置
這步不特殊直接copy過來
我的系統(tǒng)是7.3奖亚,修改臨時狀態(tài)不管用,也沒有細究析砸,因此采用的是修改配置文件的方式
=========關(guān)閉SELinux=========
# 檢查 SELinux 的狀態(tài)昔字,如果它已經(jīng)禁用,可以跳過后面的命令
sestatus
# 通過命令臨時禁用 SELinux
setenforce 0
# 或者修改配置文件 需要重啟
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# 重啟命令
reboot
=========關(guān)閉防火墻=========
# 檢查默認防火墻狀態(tài)首繁,如果返回 not running作郭,可以跳過后面的命令
firewall-cmd --state
systemctl stop firewalld # 停止 firewalld
systemctl disable firewalld # 禁用 firewall 開機啟動
=========安裝 rsync 命令=========
# 檢查是否有 rsync 命令,如果有返回 rsync 路徑弦疮,可以跳過后面的命令(我的系統(tǒng)有自帶)
which rsync
# 安裝 rsync 上面已經(jīng)配置了離線yum源直接yum安裝就行
yum -y install rsync
=========停止并禁用 NetWorkManager=========
systemctl stop NetworkManager
systemctl disable NetworkManager
=========調(diào)整最大文件打開數(shù)=========
# 檢查當(dāng)前 root 賬號下的 max open files 值
ulimit -n
##開啟編輯模式
vi /etc/security/limits.conf
## 直接將下面兩行內(nèi)容放到文件末尾
root soft nofile 102400
root hard nofile 102400
## 重新登錄一下賬戶夹攒,執(zhí)行查看 配置生效
ulimit -n
=========確認服務(wù)器時間同步=========
見代碼塊下方鏈接,我使用是ntp
=========檢查是否存在全局 HTTP 代理=========
# 檢查 http_proxy https_proxy 變量是否設(shè)置胁塞,若為空可以跳過后面的操作咏尝。
echo "$http_proxy" "$https_proxy"
1.3配置文件
文字有點多就不復(fù)制了,看官方文檔
我只修改了install.config
闲先,即將三個ip改為自己的
1.4獲取證書
需要license状土、gse模塊的mac地址
license即主控機无蜂,gse即是install.config
配置文件中ip后面帶gse的機器伺糠,拿到兩個機器的mac地址,license地址在前用英文;
隔開斥季,去官網(wǎng)生成即可
文件上傳到主控機训桶,然后解壓一波
tar xf ssl_certificates.tar.gz -C /data/src/cert/
1.5配置 SSH 免密登陸
cd /data/install
bash configure_ssh_without_pass # 根據(jù)提示輸入各主機的 root 密碼完成免密登陸配置
1.6檢查
# 假設(shè)你把藍鯨包解壓到data下
cd /data/install
bash precheck.sh
正常結(jié)果如下,如果有fail就解決酣倾,按照上面操作應(yīng)該是不會失敗的
start <<check_ssh_nopass>> ... [OK]
start <<check_password>> ... [OK]
start <<check_cert_mac>> ... [OK]
start <<check_get_lan_ip>> ... [OK]
start <<check_install_config>> ... [OK]
start <<check_selinux>> ... [OK]
start <<check_umask>> ... [OK]
start <<check_rabbitmq_version>> ... [OK]
start <<check_http_proxy>> ... [OK]
start <<check_open_files_limit>> ... [OK]
start <<check_domain>> ... [OK]
start <<check_rsync>> ... [OK]
start <<check_service_dir>> ... [OK]
start <<check_networkmanager>> ... [OK]
start <<check_firewalld>> ... [OK]
2.安裝
直接按照官方文檔的的命令安裝舵揭,當(dāng)然很可能報錯,可以參見本人經(jīng)驗
cd /data/install
# 安裝 PaaS 平臺及其依賴服務(wù)躁锡,該步驟完成后午绳,可以打開 PaaS 平臺。
./bk_install paas
# 安裝配置平臺及其依賴服務(wù)映之,該步驟完成后拦焚,可以打開配置平臺,看到藍鯨業(yè)務(wù)及示例業(yè)務(wù)杠输。
./bk_install cmdb
# 該步驟完成后赎败,可以打開作業(yè)平臺,并執(zhí)行作業(yè)蠢甲。同時在配置平臺中可以看到藍鯨的模塊下加入了主機僵刮。
# 安裝作業(yè)平臺及其依賴組件,并在安裝藍鯨的服務(wù)器上裝好 gse_agent 供驗證。
./bk_install job
# 部署正式環(huán)境及測試環(huán)境
# 該步驟完成后可以在開發(fā)者中心的服務(wù)器信息和第三方服務(wù)信息中看到已經(jīng)成功激活的服務(wù)器
# 同時也可以進行 SaaS 應(yīng)用(除藍鯨監(jiān)控和日志檢索)的上傳部署
./bk_install app_mgr
# 安裝藍鯨數(shù)據(jù)平臺基礎(chǔ)模塊及其依賴服務(wù)搞糕。安裝該模塊后勇吊,可以開始安裝使用 SaaS 應(yīng)用: 藍鯨監(jiān)控和日志檢索
### 安裝完有隱藏指令,直接執(zhí)行隱藏指令即可
./bk_install bkdata
# 安裝故障自愈的后臺模塊及依賴其服務(wù)
# 安裝該模塊后窍仰,可以開始安裝使用 SaaS 應(yīng)用: 故障自愈
### 安裝完有隱藏指令萧福,直接執(zhí)行隱藏指令即可
./bk_install fta
# 重裝 gse_agent 并注冊正確的集群模塊到配置平臺
# 執(zhí)行完該操作后,可以在配置平臺中看到主機按照 install.config 中的配置分布到對應(yīng)拓撲下
./bkcec install gse_agent
#部署官方 SaaS 到正式環(huán)境(通過命令行從 /data/src/official_saas/ 目錄自動部署 SaaS )
# 執(zhí)行完該操作后辈赋,可以在藍鯨工作臺看到并使用所有官方 SaaS
./bkcec install saas-o
3.訪問
藍鯨通訊都是使用的域名鲫忍,因此在本地訪問需要配置host,這個直接百度就行钥屈,把用到的域名都加到host就能
正常訪問了
安裝完paas后就能訪問平臺了悟民,但沒有功能,此時別手賤修改密碼篷就,因為后面的模塊需要用到admin的密碼 --射亏!,且會導(dǎo)致安裝失敗
4.安裝中遇到的問題
我的安裝目錄在 /opt/ylbzj 下竭业,解決問題時記得換一下
- 在執(zhí)行
./bk_install app_mgr
時遇到問題
異常如下
Collecting meld3>=0.6.5 (from supervisor)
Installing collected packages: meld3, supervisor
Running setup.py install for supervisor: started
Running setup.py install for supervisor: finished with status 'done'
Successfully installed meld3-1.0.2 supervisor-3.3.3
[10.0.5.48]20200303-101329 233 generate env variable settings.
[10.0.5.48]20200303-101329 151 exec: pip install --no-cache-dir -r requirements.txt (/opt/ylbzj/bkce/paas_agent/paas_agent)
Collecting Django==1.8.11 (from -r requirements.txt (line 1))
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.HTTPConnection object at 0x7fef5e7b73d0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/simple/django/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.HTTPConnection object at 0x7fef5e7b7fd0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/simple/django/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.HTTPConnection object at 0x7fef5e7551d0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/simple/django/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.HTTPConnection object at 0x7fef5e755390>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/simple/django/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.HTTPConnection object at 0x7fef5e755550>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /pypi/simple/django/
Could not find a version that satisfies the requirement Django==1.8.11 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for Django==1.8.11 (from -r requirements.txt (line 1))
[10.0.5.48]20200303-101337 177 pip install (--no-cache-dir ) for paas_agent. FAILED
[10.0.5.48]20200303-101337 47 Abort
解決(咨詢的官方技術(shù)支持):
# 一次執(zhí)行一下命令即可解決問題
touch /opt/ylbzj/src/paas_agent/paas_agent/SELF_CONTAINED_PIP_PKG
cd /opt/ylbzj/install/
echo appo appt | xargs -n1 ./bkcec sync
source utils.fc
- 仍然是在執(zhí)行
./bk_install app_mgr
時遇到問題
Collecting idna<2.9,>=2.5 (from requests==2.21.0->-r requirements.txt (line 3))
Could not find a version that satisfies the requirement idna<2.9,>=2.5 (from requests==2.21.0->-r requirements.txt (line 3)) (from versions: )
No matching distribution found for idna<2.9,>=2.5 (from requests==2.21.0->-r requirements.txt (line 3))
[10.0.5.48]20200303-145115 177 pip install (--no-cache-dir --no-index --find-links=/opt/ylbzj/src/paas_agent/support-files/pkgs) for paas_agent. FAILED
解決:
原因是/opt/ylbzj/src/paas_agent/support-files/pkgs 沒有idna-2.8-py2.py3-none-any.whl這個包智润,從其他文件夾復(fù)制過來
cp /opt/ylbzj/src/open_paas/support-files/pkgs/idna-2.8-py2.py3-none-any.whl /opt/ylbzj/src/paas_agent/support-files/pkgs/
- 依舊是在執(zhí)行
./bk_install app_mgr
時遇到問題
--> Finished Dependency Resolution
Error: Package: [selinux-policy-targeted-3.13.1-229.el7_6.6.noarch](selinux-policy-targeted-3.13.1-229.el7_6.6.noarch) (epel)
Requires: policycoreutils >= 2.5-24
Installed: [policycoreutils-2.5-8.el7.x86_64](policycoreutils-2.5-8.el7.x86_64) (@anaconda)
policycoreutils = [2.5-8.el7](2.5-8.el7)
Error: Package: [selinux-policy-3.13.1-229.el7_6.6.noarch](selinux-policy-3.13.1-229.el7_6.6.noarch) (epel)
Requires: libsemanage >= 2.5-13
Installed: [libsemanage-2.5-4.el7.x86_64](libsemanage-2.5-4.el7.x86_64) (@anaconda)
libsemanage = [2.5-4.el7](2.5-4.el7)
Error: Package: [gcc-gfortran-4.8.5-11.el7.x86_64](gcc-gfortran-4.8.5-11.el7.x86_64) (@anaconda)
Requires: gcc = [4.8.5-11.el7](4.8.5-11.el7)
Removing: [gcc-4.8.5-11.el7.x86_64](gcc-4.8.5-11.el7.x86_64) (@anaconda)
gcc = [4.8.2-16.el7](4.8.2-16.el7)
gcc = [4.8.5-11.el7](4.8.5-11.el7)
Updated By: [gcc-4.8.5-36.el7.x86_64](gcc-4.8.5-36.el7.x86_64) (epel)
gcc = [4.8.5-36.el7](4.8.5-36.el7)
gcc = [4.8.2-16.el7](4.8.2-16.el7)
Error: Package: [libquadmath-devel-4.8.5-11.el7.x86_64](libquadmath-devel-4.8.5-11.el7.x86_64) (@anaconda)
Requires: gcc = [4.8.5-11.el7](4.8.5-11.el7)
Removing: [gcc-4.8.5-11.el7.x86_64](gcc-4.8.5-11.el7.x86_64) (@anaconda)
gcc = [4.8.2-16.el7](4.8.2-16.el7)
gcc = [4.8.5-11.el7](4.8.5-11.el7)
Updated By: [gcc-4.8.5-36.el7.x86_64](gcc-4.8.5-36.el7.x86_64) (epel)
gcc = [4.8.5-36.el7](4.8.5-36.el7)
gcc = [4.8.2-16.el7](4.8.2-16.el7)
Error: Package: [selinux-policy-3.13.1-229.el7_6.6.noarch](selinux-policy-3.13.1-229.el7_6.6.noarch) (epel)
Requires: policycoreutils >= 2.5-24
Installed: [policycoreutils-2.5-8.el7.x86_64](policycoreutils-2.5-8.el7.x86_64) (@anaconda)
policycoreutils = [2.5-8.el7](2.5-8.el7)
You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
[ipa-client-4.4.0-12.el7.centos.x86_64](ipa-client-4.4.0-12.el7.centos.x86_64) has installed conflicts freeipa-client: [ipa-client-4.4.0-12.el7.centos.x86_64](ipa-client-4.4.0-12.el7.centos.x86_64)
[ipa-client-common-4.4.0-12.el7.centos.noarch](ipa-client-common-4.4.0-12.el7.centos.noarch) has installed conflicts freeipa-client-common: [ipa-client-common-4.4.0-12.el7.centos.noarch](ipa-client-common-4.4.0-12.el7.centos.noarch)
[ipa-common-4.4.0-12.el7.centos.noarch](ipa-common-4.4.0-12.el7.centos.noarch) has installed conflicts freeipa-common: [ipa-common-4.4.0-12.el7.centos.noarch](ipa-common-4.4.0-12.el7.centos.noarch)
解決:
這個是由于yum源中的版本比較低,切換為高版本的yum源即可(還好當(dāng)時我有一個7.6的yum源未辆,直接切了事)
- 修改域名
第一步:修改 globale.env 中的域名配置信息窟绷。
第二步:修改 每臺機器上的 /etc/hosts 匹配上新的域名。host文件是安裝腳本自動寫的咐柜,如修改域名需要修改host文件兼蜈,否則部分業(yè)務(wù)會出現(xiàn)會掉失敗的情況
第三步:修改完成后按如下命令順序執(zhí)行:
cd 藍鯨install目錄
./bkcec sync common
echo fta bkdata job cmdb paas nginx | xargs -n 1 ./bkcec stop
echo fta bkdata job cmdb paas nginx | xargs -n 1 ./bkcec render
echo nginx paas cmdb job bkdata fta | xargs -n 1 ./bkcec start
第四部:如果有安裝 SaaS ,到 開發(fā)者中心->Smart 應(yīng)用->已上線 的 SaaS 操作欄里的【部署 】按鈕拙友,重新【一鍵部署】 SaaS为狸。記得重新部署否則也會出現(xiàn)調(diào)用失敗的情況