keepalived之 ipvsadm-1.26-4(lvs)+ keepalived-1.2.24 安裝
一、安裝 LVS
前提:已經提前配置好本地 Yum 源 配置過程可參考> http://blog.csdn.net/zhang123456456/article/details/56690945
1、 檢查一下系統核心
安裝之前,首先檢查一下系統核心是否支援LVS的IPVS模組;自Linux 2.6開始,系統核心完全內建了LVS的各個模組。
[root@mysql03 ~]# modprobe -l|grep ipvs
kernel/net/netfilter/ipvs/ip_vs.ko
kernel/net/netfilter/ipvs/ip_vs_rr.ko
kernel/net/netfilter/ipvs/ip_vs_wrr.ko
kernel/net/netfilter/ipvs/ip_vs_lc.ko
....
kernel/net/netfilter/ipvs/ip_vs_pe_sip.ko
看到如上輸出資訊,則表明系統核心預設支援IPVS模組。
2、安裝依賴包
由於是原始碼包安裝,所以編譯時需要打上如下依賴包。
# yum -y install kernel-headers glibc-headers glibc-devel libgomp gcc libstdc++-devel gcc-c++
3、 yum安裝 ipvsadm-1.26-4
[root@mysql03 ~]# yum -y install kernel-devel ipvsadm
===================================================================================
Package Arch Version Repository Size
===================================================================================
Installing:
ipvsadm x86_64 1.26-4.el6 c6-media 42 k
Transaction Summary
===================================================================================
Install 1 Package(s)
Total download size: 42 k
Installed size: 78 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ipvsadm-1.26-4.el6.x86_64 1/1
Verifying : ipvsadm-1.26-4.el6.x86_64 1/1
Installed:
ipvsadm.x86_64 0:1.26-4.el6
Complete!
4、 做個 ln
[root@mysql03 ~]# ln -sv /usr/src/kernels/2.6.32-573.el6.x86_64/ /usr/src/linux <--請自行修改 kernels 版本號
5、 檢視 ipvsadm 版本資訊
[root@mysql03 ~]# ipvsadm -version
ipvsadm v1.26 2008/5/15 (compiled with popt and IPVS v1.2.1) #> 能看到幫助資訊,則說明IPVS安裝成功。
二、 安裝 keepalived-1.2.24
1、官網下載地址:
[root@mysql03 ~]# wget
2、解壓安裝包:
[root@mysql03 ~]# ll keepalived-1.2.24.tar.gz
-rw-r--r--. 1 root root 601873 Jun 16 23:49 keepalived-1.2.24.tar.gz
[root@mysql03 ~]# tar -zxvf keepalived-1.2.24.tar.gz
3、進入安裝目錄:
[root@mysql03 ~]# cd keepalived-1.2.24
4、安裝keepalived:
[root@mysql03 keepalived-1.2.24]# ./configure --prefix=/usr/local/keepalived --with-kernel-dir=/usr/src/kernels/2.6.32-573.el6.x86_64/
說明:--with-kernel-dri :指定使用核心原始碼中的標頭檔案,即include目錄,該引數很重要,只有使用LVS時才用此引數。
主要輸出:
Keepalived configuration
------------------------
Keepalived version : 1.2.24
Compiler : gcc
Preprocessor flags :
Compiler flags : -Wall -Wunused -Wstrict-prototypes
Linker flags :
Extra Lib : -ldl -lssl -lcrypto
Use IPVS Framework : Yes
IPVS use libnl : No
IPVS syncd attributes : No
IPVS 64 bit stats : No
fwmark socket support : Yes
Use VRRP Framework : Yes
Use VRRP VMAC : Yes
Use VRRP authentication : Yes
With ip rules/routes : Yes
SNMP keepalived support : No
SNMP checker support : No
SNMP RFCv2 support : No
SNMP RFCv3 support : No
SHA1 support : No
Use Debug flags : No
Stacktrace support : No
Memory alloc check : No
libnl version : None
Use IPv4 devconf : No
Use libiptc : No
Use libipset : No
Build genhash : Yes
Build documentation : No
[root@mysql03 keepalived-1.2.24]# make && make install
5、複製指令碼和檔案:
5.1 複製執行檔案
[root@mysql03 keepalived-1.2.24]# cp /usr/local/keepalived/sbin/keepalived /usr/sbin/
5.2 將init.d檔案複製到etc下,加入開機啟動項
[root@node6 keepalived-1.2.16]# cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/
5.3 將keepalived檔案複製到etc下,加入網路卡配置
[root@node6 keepalived-1.2.16]# cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/
5.4 建立keepalived資料夾
[root@node6 keepalived-1.2.16]# mkdir /etc/keepalived
5.5 將keepalived配置檔案複製到etc下
[root@node6 keepalived-1.2.16]# cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
5.6 複製啟動指令碼
[root@node6 keepalived-1.2.16]# cp /usr/local/keepalived/sbin/keepalived /etc/keepalived/
6、加入開機啟動項
[root@mysql03 keepalived-1.2.24]# chkconfig --add keepalived #新增時必須保證/etc/init.d/keepalived存在
7、 啟動
[root@mysql03 keepalived-1.2.24]# chmod 755 /etc/init.d/keepalived
[root@mysql03 keepalived-1.2.24]# service keepalived start
Starting keepalived: [ OK ]
8、 關閉
[root@mysql03 keepalived-1.2.24]# service keepalived stop
Stopping keepalived: [ OK ] > OK,成功!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2140850/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- keepalived(三)LVS+Keepalived
- LVS搭配Keepalived
- KeepAlived+LVS+NginxNginx
- LVS+Keepalived群集
- LVS+keepalived高可用
- keepalived安裝
- LVS+Keepalived高可用群集
- Keepalived之高可用LVS叢集
- keepalived 安裝部署
- LVS和keepalived高可用叢集部署
- LVS+KEEPALIVED負載均衡實驗負載
- web、keepalived、lvs、nginx 面試常問解析WebNginx面試
- LVS#MySQL+Keepalived四層負載均衡MySql負載
- 綜合專案:lvs+keepalived+glusterfs群集
- 使用Keepalived構建LVS高可用叢集
- lvs+keepAlived→效率最高的負載均衡負載
- LVS+Keepalived 實現高可用負載均衡負載
- LVS+Keepalived 高可用群集(理論+實戰部署)
- LVS - 使用用Keepalived實現健康檢查的示例
- LVS + Keepalived + Nginx基於DR模式構建高可用方案Nginx模式
- keepalived詳解 - LVS(IPVS)管理工具ipvsadm簡介
- centos7上keepalived的安裝和配置CentOS
- 基於MySQL Cluster + LVS + KeepAlived部署負載均衡高可用架構MySql負載架構
- 002.LVS管理工具的安裝與使用
- Ubuntu 下安裝 keepalived 和 Nginx負載均衡 轉發UbuntuNginx負載
- MYSQL5.7.22 原始碼安裝 主從搭建 + KEEPALIVED高可用MySql原始碼
- 負載均衡之keepalived負載
- ffmpeg安裝之mac安裝Mac
- 使用LVS實現負載均衡原理及安裝配置詳解負載
- 基於MySQL雙主複製架構下部署LVS+KeepAlived負載均衡MySql架構負載
- 負載均衡之--Nginx、LVS、HAProxy負載Nginx
- ffmpeg安裝之linux編譯安裝Linux編譯
- WEB服務-Nginx之十-keepalivedWebNginx
- LVS 負載均衡之 VS/NAT 模式負載模式
- LVS 負載均衡之 VS/TUN 模式負載模式
- LVS 負載均衡之 VS/DR 模式負載模式
- Flutter起步之安裝Flutter
- 負載均衡之LVS與Nginx對比負載Nginx
- LVS