keepalived centos 7

# SIMPLE CONFIGURATION WITH FLOATING IP

# MASTER SERVER
yum install keepalived
# cat > /etc/keepalived/keepalived.conf
# create new
global_defs {
    notification_email {
        alex@alexlinux.com
    }
    notification_email_from alex@alexlinux.com
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_Server
}
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    nopreempt
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass alexlinux
    }

    virtual_ipaddress {
        # virtual IP address
        10.88.1.100 dev eth0
    }
}
systemctl enable keepalived
systemctl start keepalived

# SLAVE SERVER
yum install keepalived
# cat > /etc/keepalived/keepalived.conf
# create new
global_defs {
    notification_email {
        alex@alexlinux.com
    }
    notification_email_from alex@alexlinux.com
    smtp_server 127.0.0.1
    smtp_connect_timeout 30
    router_id LVS_Server
}
vrrp_instance VI_1 {
    state SLAVE 
    interface eth0
    virtual_router_id 51
    priority 100
    nopreempt
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass alexlinux
    }

    virtual_ipaddress {
        # virtual IP address
        10.88.1.100 dev eth0
    }
}
systemctl enable keepalived
systemctl start keepalived

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>