轉載自素文宅博客:https://blog.yoodb.com/yoodb/article/detail/1434python
因爲公司業務併發比較高須要高可用使用LVS keeplived
。在linux
系統centos6.5
版本中安裝keeplived
時,須要安裝penssl-devel
依賴包,可是服務器是不容許鏈接外網(互聯網)的,沒法使用yum
命令進行安裝操做,因此本人研究了一下如何在離線狀態下安裝penssl-devel
依賴包。感受不少坑,因此分享一下我的總結。linux
在沒有安裝openssl-devel
依賴包時,進行安裝keeplived時可能出現的錯誤信息:centos
一:提示openssl未正確安裝錯誤信息以下:bash
configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!
二:提示OpenSSL MD5庫是必需的錯誤信息以下:服務器
configure: error: OpenSSL MD5 libraries are required
爲了查找安裝openssl-devel
包時所須要的其餘依賴包(此步你們能夠跳過,直接瀏覽下一步),本人專門搞了個能夠鏈接外網的服務器,執行yum install -y openssl openssl-devel
命令,輸出日誌以下:網絡
Running Transaction
Updating : libcom_err-1.41.12-23.el6.x86_64 1/32
Updating : libselinux-2.0.94-7.el6.x86_64 2/32
Updating : keyutils-libs-1.4-5.el6.x86_64 3/32
Updating : krb5-libs-1.10.3-65.el6.x86_64 4/32
Installing : libkadm5-1.10.3-65.el6.x86_64 5/32
Updating : libss-1.41.12-23.el6.x86_64 6/32
Updating : openssl-1.0.1e-57.el6.x86_64 7/32
Installing : keyutils-libs-devel-1.4-5.el6.x86_64 8/32
Updating : e2fsprogs-libs-1.41.12-23.el6.x86_64 9/32
Installing : libcom_err-devel-1.41.12-23.el6.x86_64 10/32
Installing : libsepol-devel-2.0.41-4.el6.x86_64 11/32
Installing : libselinux-devel-2.0.94-7.el6.x86_64 12/32
Installing : krb5-devel-1.10.3-65.el6.x86_64 13/32
Installing : zlib-devel-1.2.3-29.el6.x86_64 14/32
Installing : openssl-devel-1.0.1e-57.el6.x86_64 15/32
Updating : e2fsprogs-1.41.12-23.el6.x86_64 16/32
Updating : krb5-workstation-1.10.3-65.el6.x86_64 17/32
Updating : keyutils-1.4-5.el6.x86_64 18/32
Updating : libselinux-python-2.0.94-7.el6.x86_64 19/32
Updating : libselinux-utils-2.0.94-7.el6.x86_64 20/32
Cleanup : krb5-workstation-1.10.3-10.el6_4.6.x86_64 21/32
Cleanup : e2fsprogs-1.41.12-18.el6.x86_64 22/32
Cleanup : openssl-1.0.1e-15.el6.x86_64 23/32
Cleanup : krb5-libs-1.10.3-10.el6_4.6.x86_64 24/32
Cleanup : e2fsprogs-libs-1.41.12-18.el6.x86_64 25/32
Cleanup : libss-1.41.12-18.el6.x86_64 26/32
Cleanup : libselinux-utils-2.0.94-5.3.el6_4.1.x86_64 27/32
Cleanup : libselinux-python-2.0.94-5.3.el6_4.1.x86_64 28/32
Cleanup : keyutils-1.4-4.el6.x86_64 29/32
Cleanup : keyutils-libs-1.4-4.el6.x86_64 30/32
Cleanup : libselinux-2.0.94-5.3.el6_4.1.x86_64 31/32
Cleanup : libcom_err-1.41.12-18.el6.x86_64 32/32
Verifying : e2fsprogs-1.41.12-23.el6.x86_64 1/32
Verifying : krb5-devel-1.10.3-65.el6.x86_64 2/32
Verifying : libcom_err-1.41.12-23.el6.x86_64 3/32
Verifying : krb5-libs-1.10.3-65.el6.x86_64 4/32
Verifying : e2fsprogs-libs-1.41.12-23.el6.x86_64 5/32
Verifying : krb5-workstation-1.10.3-65.el6.x86_64 6/32
Verifying : keyutils-libs-devel-1.4-5.el6.x86_64 7/32
Verifying : libcom_err-devel-1.41.12-23.el6.x86_64 8/32
Verifying : zlib-devel-1.2.3-29.el6.x86_64 9/32
Verifying : keyutils-libs-1.4-5.el6.x86_64 10/32
Verifying : openssl-devel-1.0.1e-57.el6.x86_64 11/32
Verifying : keyutils-1.4-5.el6.x86_64 12/32
Verifying : libselinux-python-2.0.94-7.el6.x86_64 13/32
Verifying : libss-1.41.12-23.el6.x86_64 14/32
Verifying : libsepol-devel-2.0.41-4.el6.x86_64 15/32
Verifying : libselinux-utils-2.0.94-7.el6.x86_64 16/32
Verifying : openssl-1.0.1e-57.el6.x86_64 17/32
Verifying : libkadm5-1.10.3-65.el6.x86_64 18/32
Verifying : libselinux-2.0.94-7.el6.x86_64 19/32
Verifying : libselinux-devel-2.0.94-7.el6.x86_64 20/32
Verifying : e2fsprogs-1.41.12-18.el6.x86_64 21/32
Verifying : libselinux-2.0.94-5.3.el6_4.1.x86_64 22/32
Verifying : openssl-1.0.1e-15.el6.x86_64 23/32
Verifying : libselinux-utils-2.0.94-5.3.el6_4.1.x86_64 24/32
Verifying : libss-1.41.12-18.el6.x86_64 25/32
Verifying : libcom_err-1.41.12-18.el6.x86_64 26/32
Verifying : e2fsprogs-libs-1.41.12-18.el6.x86_64 27/32
Verifying : libselinux-python-2.0.94-5.3.el6_4.1.x86_64 28/32
Verifying : keyutils-libs-1.4-4.el6.x86_64 29/32
Verifying : krb5-libs-1.10.3-10.el6_4.6.x86_64 30/32
Verifying : keyutils-1.4-4.el6.x86_64 31/32
Verifying : krb5-workstation-1.10.3-10.el6_4.6.x86_64 32/32
Installed:
openssl-devel.x86_64 0:1.0.1e-57.el6
Dependency Installed:
keyutils-libs-devel.x86_64 0:1.4-5.el6 krb5-devel.x86_64 0:1.10.3-65.el6
libcom_err-devel.x86_64 0:1.41.12-23.el6
libkadm5.x86_64 0:1.10.3-65.el6 libselinux-devel.x86_64 0:2.0.94-7.el6
libsepol-devel.x86_64 0:2.0.41-4.el6
zlib-devel.x86_64 0:1.2.3-29.el6
Updated:
openssl.x86_64 0:1.0.1e-57.el6
Dependency Updated:
e2fsprogs.x86_64 0:1.41.12-23.el6 e2fsprogs-libs.x86_64 0:1.41.12-23.el6
keyutils.x86_64 0:1.4-5.el6 keyutils-libs.x86_64 0:1.4-5.el6
krb5-libs.x86_64 0:1.10.3-65.el6
krb5-workstation.x86_64 0:1.10.3-65.el6 libcom_err.x86_64 0:1.41.12-23.el6 libselinux.x86_64 0:2.0.94-7.el6
libselinux-python.x86_64 0:2.0.94-7.el6 libselinux-utils.x86_64 0:2.0.94-7.el6 libss.x86_64 0:1.41.12-23.el6
Complete!
經過上述日誌分析,使用rpm
命令離線安裝openssl-devel
包,所需rpm
包具體以下:併發
libcom_err-1.41.12-23.el6.x86_64.rpm
libselinux-2.0.94-7.el6.x86_64.rpm
keyutils-libs-1.4-5.el6.x86_64.rpm
krb5-libs-1.10.3-65.el6.x86_64.rpm
libkadm5-1.10.3-65.el6.x86_64.rpm
libss-1.41.12-23.el6.x86_64.rpm
openssl-1.0.1e-57.el6.x86_64.rpm
keyutils-libs-devel-1.4-5.el6.x86_64.rpm
e2fsprogs-libs-1.41.12-23.el6.x86_64.rpm
libcom_err-devel-1.41.12-23.el6.x86_64.rp
libsepol-devel-2.0.41-4.el6.x86_64.rpm
libselinux-devel-2.0.94-7.el6.x86_64.rpm
krb5-devel-1.10.3-65.el6.x86_64.rpm
zlib-devel-1.2.3-29.el6.x86_64.rpm
openssl-devel-1.0.1e-57.el6.x86_64.rpm
e2fsprogs-1.41.12-23.el6.x86_64.rpm
krb5-workstation-1.10.3-65.el6.x86_64.rpm
keyutils-1.4-5.el6.x86_64.rpm
libselinux-python-2.0.94-7.el6.x86_64.rpm
libselinux-utils-2.0.94-7.el6.x86_64.rpm
rpm包下載地址:ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/,(網絡資料,rpm包種類很全),在linux系統能夠經過wget命令下載全部的包,新建download-packages.sh
文件,將以下內容增長到文件,具體內容以下:ui
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/e2fsprogs-1.41.12-23.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/e2fsprogs-libs-1.41.12-23.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/keyutils-1.4-5.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/keyutils-libs-1.4-5.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/keyutils-libs-devel-1.4-5.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/krb5-devel-1.10.3-65.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/krb5-libs-1.10.3-65.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/krb5-workstation-1.10.3-65.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libcom_err-1.41.12-23.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libcom_err-devel-1.41.12-23.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libkadm5-1.10.3-65.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libselinux-2.0.94-7.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libselinux-devel-2.0.94-7.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libselinux-python-2.0.94-7.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libselinux-utils-2.0.94-7.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libsepol-devel-2.0.41-4.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/libss-1.41.12-23.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/openssl-1.0.1e-57.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/openssl-devel-1.0.1e-57.el6.x86_64.rpm
wget ftp://mirror.switch.ch/mirror/centos/6/os/x86_64/Packages/zlib-devel-1.2.3-29.el6.x86_64.rpm
授予download-packages.sh
文件執行權限,並執行腳本命令,具體以下:this
[root@yoodb openssl-devel-packages]# chmod 777 download-packages.sh
[root@yoodb openssl-devel-packages]# ./download-packages.sh
執行完成後,目錄下會存在openssl-devel所須要的依賴包,依賴包信息以下:日誌
[root@yoodb openssl-devel-packages]# ll
total 6456
-rwxrwxrwx. 1 root root 2171 Sep 4 17:20 downloadpackages.sh
-rw-r--r--. 1 root root 567328 Sep 4 17:21 e2fsprogs-1.41.12-23.el6.x86_64.rpm
-rw-r--r--. 1 root root 124172 Sep 4 17:21 e2fsprogs-libs-1.41.12-23.el6.x86_64.rpm
-rw-r--r--. 1 root root 40152 Sep 4 17:21 keyutils-1.4-5.el6.x86_64.rpm
-rw-r--r--. 1 root root 20684 Sep 4 17:22 keyutils-libs-1.4-5.el6.x86_64.rpm
-rw-r--r--. 1 root root 29456 Sep 4 17:22 keyutils-libs-devel-1.4-5.el6.x86_64.rpm
-rw-r--r--. 1 root root 516132 Sep 4 17:22 krb5-devel-1.10.3-65.el6.x86_64.rpm
-rw-r--r--. 1 root root 691188 Sep 4 17:22 krb5-libs-1.10.3-65.el6.x86_64.rpm
-rw-r--r--. 1 root root 833612 Sep 4 17:22 krb5-workstation-1.10.3-65.el6.x86_64.rpm
-rw-r--r--. 1 root root 38516 Sep 4 17:22 libcom_err-1.41.12-23.el6.x86_64.rpm
-rw-r--r--. 1 root root 33664 Sep 4 17:23 libcom_err-devel-1.41.12-23.el6.x86_64.rpm
-rw-r--r--. 1 root root 146500 Sep 4 17:23 libkadm5-1.10.3-65.el6.x86_64.rpm
-rw-r--r--. 1 root root 111508 Sep 4 17:23 libselinux-2.0.94-7.el6.x86_64.rpm
-rw-r--r--. 1 root root 140160 Sep 4 17:23 libselinux-devel-2.0.94-7.el6.x86_64.rpm
-rw-r--r--. 1 root root 207796 Sep 4 17:23 libselinux-python-2.0.94-7.el6.x86_64.rpm
-rw-r--r--. 1 root root 84072 Sep 4 17:23 libselinux-utils-2.0.94-7.el6.x86_64.rpm
-rw-r--r--. 1 root root 65484 Sep 4 17:23 libsepol-devel-2.0.41-4.el6.x86_64.rpm
-rw-r--r--. 1 root root 42896 Sep 4 17:24 libss-1.41.12-23.el6.x86_64.rpm
-rw-r--r--. 1 root root 1600772 Sep 4 17:24 openssl-1.0.1e-57.el6.x86_64.rpm
-rw-r--r--. 1 root root 1227684 Sep 4 17:24 openssl-devel-1.0.1e-57.el6.x86_64.rpm
-rw-r--r--. 1 root root 44984 Sep 4 17:24 zlib-devel-1.2.3-29.el6.x86_64.rpm
linux
下批量安裝某個目錄下全部rpm
包,使用rpm命令時帶--force參數,具體命令rpm -Uvh --force *.rpm
:
[root@yoodb openssl-devel-packages]# rpm -Uvh --force *.rpm
warning: e2fsprogs-1.41.12-23.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:libcom_err ########################################### [ 5%]
2:libselinux ########################################### [ 10%]
3:keyutils-libs ########################################### [ 15%]
4:krb5-libs ########################################### [ 20%]
5:libkadm5 ########################################### [ 25%]
6:libss ########################################### [ 30%]
7:openssl ########################################### [ 35%]
8:keyutils-libs-devel ########################################### [ 40%]
9:e2fsprogs-libs ########################################### [ 45%]
10:libcom_err-devel ########################################### [ 50%]
11:zlib-devel ########################################### [ 55%]
12:libsepol-devel ########################################### [ 60%]
13:libselinux-devel ########################################### [ 65%]
14:krb5-devel ########################################### [ 70%]
15:openssl-devel ########################################### [ 75%]
16:e2fsprogs ########################################### [ 80%]
17:krb5-workstation ########################################### [ 85%]
18:keyutils ########################################### [ 90%]
19:libselinux-python ########################################### [ 95%]
20:libselinux-utils ########################################### [100%]
另外一種方式離線安裝openssl-devel
依賴包,就是將Redhat ISO
文件當作yum本地數據源,配置完成後,直接使用yum install -y openssl openssl-devel
命令。
上述問題解決成功後,繼續執行./configure --prefix=/usr/local/keepalived
命令,報「*** WARNING - this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.
」錯誤,解決方案:Keepalived-1.3.5編譯安裝步驟和啓動方式詳解:https://blog.yoodb.com/yoodb/article/detail/1378