#防火墙放通vrrpfirewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.12.0/24" protocol value="vrrp" accept"firewall-cmd --reload#MASTER:192.168.12.77 PS:interface 填网卡名称,unicast_peer 填 backup机器IP地址 auth_pass必需一致vi /etc/keepalived/keepalived.confglobal_defs {router_id LVS_DEVEL_03}vrrp_instance VI_1 {state MASTERinterface ens32virtual_router_id 51priority 100advert_int 1unicast_src_ip 192.168.12.77unicast_peer {192.168.12.78}authentication {auth_type PASSauth_pass test1234}virtual_ipaddress {192.168.12.79}}systemctl restart keepalived #重启keepalived#BACKUP:192.168.12.78 PS:interface 填网卡名称,unicast_peer 填 master机器IP地址 auth_pass必需一致vi /etc/keepalived/keepalived.confglobal_defs {router_id LVS_DEVEL_04}vrrp_instance VI_1 {state BACKUPinterface ens32virtual_router_id 51priority 80advert_int 1unicast_src_ip 192.168.12.78unicast_peer {192.168.12.77}authentication {auth_type PASSauth_pass test1234}virtual_ipaddress {192.168.12.79}}systemctl restart keepalived #重启keepalived

