6, Keepalived+lvs implementation of scheduling, high availability, high-performance cluster
650) this.width=650; "src=" Http://note.youdao.com/yws/res/21139/5A90D062140744BA99DD87E647440CF4 "alt=" Qq20150728172032.png "/>
The role of keepalived is:
detects the status of the Web server, and if a Web server freezes or fails, keepalived detects and rejects the failed Web server from the system. When the Web server is working properly, Keepalived automatically joins the Web server to the server farm, all of which are automatically completed without human intervention and need to be done manually to repair the failed Web server
(1) Installation keepalived
#./configure--prefix=/usr/local/keepalived--enable-snmp--enable-profile--with-kernel-version=2.6--sysconfdir=/ etc
# make && make install
(2) configuration keepalived
# cd/etc/keepalived
# Vim Keepalived.conf
Global_defs {
Notification_email {
[Email protected]
}
Notification_email_from [email protected]
Smtp_server 127.0.0.1
Smtp_connect_timeout 30
router_id LVS-S1
}
Vrrp_instance Vi_1 {
State MASTER
Interface eth0
VIRTUAL_ROUTER_ID 30
Priority 100
Advert_int 1
Authentication {
Auth_type PASS
Auth_pass AIXOCM
}
virtual_ipaddress {
172.16.10.10/24 Dev eth0
}
}
Virtual_server 172.16.10.10 80 {
Delay_loop 3
Lb_algo WRR
Lb_kind DR
Nat_mask 255.255.255.0
Persistence_timeout 60
Protocol TCP
Real_server 172.16.20.20 80 {
Weight 2
Tcp_check {
Connect_timeout 3
Nb_get_retry 3
Delay_before_retry 3
Connect_port 80
}
}
Real_server 172.16.20.30 80 {
Weight 3
Tcp_check {
Connect_timeout 3
Nb_get_retry 3
Delay_before_retry 3
Connect_port 80
}
}
}
# vim/etc/sysconfig/keepalived
keepalived_options= "-d-f/etc/keepalived/keepalived.conf"
This article is from the "Zhanglulu" blog, make sure to keep this source http://zhanglulu913.blog.51cto.com/10592685/1688962
Keepalived+lvs for scheduling, high availability, high performance clustering