系统:CentOS5.6
! Configuration File for keepalived global_defs { router_id dr1 } vrrp_sync_group web122 { group { apache122 } } vrrp_sync_group web123 { group { apache123 } } vrrp_instance apache122 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 10.0.1.250 } } virtual_server 10.0.1.250 80 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 10.0.1.122 80 { weight 1 TCP_CHECK { connect_timeout 3 connect_port 80 } } } vrrp_instance apache123 { state BACKUP interface eth0 virtual_router_id 52 priority 99 advert_int 1 authentication { auth_type PASS auth_pass 2222 } virtual_ipaddress { 10.0.1.251 } } virtual_server 10.0.1.251 80 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 10.0.1.123 80 { weight 1 TCP_CHECK { connect_timeout 3 connect_port 80 } } } | ! Configuration File for keepalived global_defs { router_id dr2 } vrrp_sync_group web122 { group { apache122 } } vrrp_sync_group web123 { group { apache123 } } vrrp_instance apache123 { state MASTER interface eth0 virtual_router_id 52 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 2222 } virtual_ipaddress { 10.0.1.251 } } virtual_server 10.0.1.251 80 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 10.0.1.123 80 { weight 1 TCP_CHECK { connect_timeout 3 connect_port 80 } } } vrrp_instance apache122 { state BACKUP interface eth0 virtual_router_id 51 priority 99 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 10.0.1.250 } } virtual_server 10.0.1.250 80 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 10.0.1.122 80 { weight 1 TCP_CHECK { connect_timeout 3 connect_port 80 } } } |