Keepalived学习笔记--LVS+Keepalived+Apache负载均衡架构
! Configuration File for keepalivedglobal_defs {
notification_email {
stzhou@stephenzhou.net
}
notification_email_from administrator@stephenzhou.net
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_MASTER # 从调度器此处需要修改为LVS_BACKUP
}
vrrp_instance VI_1 {
state MASTER # 从调度器此处需要修改为BACKUP
interface eth1
virtual_router_id 51
priority 150 # 从调度器此处需要修改为100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.2.29
}
}
virtual_server 192.168.2.29 80 {
delay_loop 6
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
real_server 192.168.2.19 80 {
weight 1
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
real_server 192.168.2.20 80 {
weight 1
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
页:
[1]