centos7 deployment keepalived

yum install keepalived -y

/Etc/keepalived.conf modify configuration files, to achieve high availability status

vim /etc/keepalived/keepalived.conf

! Configuration File for keepalived

global_defs {

   router_id MASTER # primary write MASTER, prepared to write BACKUP

}

vrrp_instance VI_1 {

    state MASTER # primary write MASTER, prepared to write BACKUP

    Effective NIC of the machine interface eth0 #

    virtual_router_id 51 # high-availability cluster group in the id

    priority 100 # priority weights, the primary value is higher than the standby

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }

    virtual_ipaddress {

        Virtual VIP 192.168.108.200 #

    }

}

 

systemctl start keepalived
systemctl enable keepalived

 

Guess you like

Origin www.cnblogs.com/leiwenbin627/p/11511953.html