生产环境下的keepalived

[root@LB2 ~]# cat /etc/keepalived/keepalived.conf 
! Configuration File for keepalived

global_defs {
        notification_email {
                [email protected]
        }
        notification_email_from [email protected]
                smtp_server 10.0.0.1
                smtp_connect_timeout 30
                router_id LVS_2
}

vrrp_instance VI_1 {
        state BACKUP
                interface eth0
                virtual_router_id 55
                priority 100
                advert_int 1
                authentication {
                        auth_type PASS
                                auth_pass 1111
                }
        virtual_ipaddress {
                192.168.220.110/24
        }


virtual_server 192.168.220.110 80 {
        delay_loop 6
        lb_algo wrr
        lb_kind DR
        nat_mask 255.255.255.0
        persistence_timeout 300
        protocol TCP
}

real_server 192.168.220.129 80 {
        weight 1
        TCP_CHECK {
                        connect_timeout 8
                        nb_get_retry 3
                        delay_before_retry 3
                        connect_port 80
                }
}


real_server 192.168.220.138 80 {
        weight 1
        TCP_CHECK {
                        connect_timeout 8
                        nb_get_retry 3
                        delay_before_retry 3
                        connect_port 80
                }
}
}

猜你喜欢

转载自blog.csdn.net/weixin_42674948/article/details/81509701
今日推荐