keepalived + lvs configuration

keepalived + lvs configuration

mark

Not used before keepalived ipvs add your own rules are, including vip. But after we have keepalived, all of the director (vs) configured by keepalived complete.

But also on the back-end health check function, when the back-end apache can not access, you can automatically change the rules to make it off the assembly line, flattered

When the following settings keepalived

103 disposed below keepalived

107 keepalived configuration change what priority on the list


vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    nopreempt
    priority 30
    advert_int 1
    virtual_ipaddress {
    10.0.0.100 dev eth0 label eth0:1
    }

}

virtual_server  10.0.0.100  80  {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    protocol TCP

    sorry_server 192.168.1.106 80

    real_server 192.168.1.104 80 {
        weight 1
        TCP_CHECK {
                connect_timeout 5
                retry 3
                delay_before_retry 3
                connect_timeout 3
                connect_port 80
        }
    }

    real_server 192.168.1.105 80 {
        weight 1
        TCP_CHECK {
                connect_timeout 5
                retry 3
                delay_before_retry 3

                connect_timeout 3
                connect_port 80
        }
    }
Published 62 original articles · won praise 7 · views 1237

Guess you like

Origin blog.csdn.net/qq_36801585/article/details/105137530