global_defs {
notification_email {
root@example.com
}
notification_email_from keepalived@example.com
smtp_server 172.16.10.9
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 10
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass MasBac
}
virtual_ipaddress {
172.16.10.68
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth0
virtual_router_id 15
priority 98
advert_int 1
authentication {
auth_type PASS
auth_pass DouMas
}
virtual_ipaddress {
172.16.10.69
}
}
virtual_server 172.16.10.68 80 {
delay_loop 6
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
sorry_server 172.16.10.77 80
real_server 172.16.10.122 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
real_server 172.16.10.133 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
virtual_server 172.16.10.69 80 {
delay_loop 6
lb_algo rr
lb_kind DR
protocol TCP
sorry_server 172.16.10.77 80
real_server 172.16.10.122 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
real_server 172.16.10.133 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
! Configuration File
for
keepalived
global_defs {
notification_email {
root@example.com
}
notification_email_from keepalived@example.com
smtp_server 172.16.10.9
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 10
priority 98
advert_int 1
authentication {
auth_type PASS
auth_pass MasBac
}
virtual_ipaddress {
172.16.10.68
}
}
vrrp_instance VI_2 {
state MASTER
interface eth0
virtual_router_id 15
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass DouMas
}
virtual_ipaddress {
172.16.10.69
}
}
virtual_server 172.16.10.68 80 {
delay_loop 6
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
sorry_server 172.16.10.77 80
real_server 172.16.10.122 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
real_server 172.16.10.133 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
virtual_server 172.16.10.69 80 {
delay_loop 6
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
sorry_server 172.16.10.77 80
real_server 172.16.10.122 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
real_server 172.16.10.133 80 {
weight 1
HTTP_GET {
url {
path /
status_code 200
}
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}