2017年9月25日 | Leave a comment 问题: 解决: 还有问题 同网段内 实现 keepalived 挂掉后自动切换,但是没有实现 nginx 挂掉切换 keepalived 后的114 老是不能转发 global_defs { router_id haproxy-ha # vrrp_skip_check_adv_addr # vrrp_strict # vrrp_garp_interval 0 # vrrp_gna_interval 0 } vrrp_instance VI_1 { state MASTER interface enp0s8 virtual_router_id 51 priority 100 advert_int 1 debug authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.198.233/24 } } virtual_server 192.168.198.233 80 { delay_loop 3 lb_algo wrr #lb_kind DR lb_kind NAT #nait_mask 255.255.255.0 protocol TCP real_server 192.168.198.114 80 { weight 1 inhibit_on_failure HTTP_GET { url { path / status_code 200 } } } real_server 192.168.198.113 80 { weight 1 inhibit_on_failure HTTP_GET { url { path / status_code 200 } } } } 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 global_defs { router_id haproxy-ha# vrrp_skip_check_adv_addr# vrrp_strict# vrrp_garp_interval 0# vrrp_gna_interval 0}vrrp_instance VI_1 { state MASTER interface enp0s8 virtual_router_id 51 priority 100 advert_int 1 debug authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.198.233/24 }}virtual_server 192.168.198.233 80 { delay_loop 3 lb_algo wrr #lb_kind DR lb_kind NAT #nait_mask 255.255.255.0 protocol TCP real_server 192.168.198.114 80 { weight 1 inhibit_on_failure HTTP_GET { url { path / status_code 200 } } } real_server 192.168.198.113 80 { weight 1 inhibit_on_failure HTTP_GET { url { path / status_code 200 } } }} 参考: 《KeepAlived权威指南.pdf》 man keepalived.conf