1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| yum install -y popt-devel gcc yum install -y kernel kernel-devel
wget http://www.keepalived.org/software/keepalived-1.2.7.tar.gz tar -zxf keepalived-1.2.7.tar.gz cd keepalived-1.2.7
./configure --sysconf=/etc --prefix=/usr/local/keepalived --with-kernel-dir=/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/
Keepalived configuration ------------------------ Keepalived version : 1.2.7 Compiler : gcc Compiler flags : -g -O2 Extra Lib : -lpopt -lssl -lcrypto Use IPVS Framework : Yes IPVS sync daemon support : Yes IPVS use libnl : No Use VRRP Framework : Yes Use VRRP VMAC : Yes SNMP support : No Use Debug flags : No
make make install
cp /usr/local/keepalived/sbin/keepalived /usr/sbin/
vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs { notification_email { } router_id LVS_DEVEL }
vrrp_script chk_http_port { script "</dev/tcp/127.0.0.1/80" interval 1 weight -2 }
vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.56.190 } track_script { chk_http_port } }
|