标签:没有 address email auth 网卡名 serve 两台 failover 文件
keepalived一、关闭防火墙(所有虚拟机)
systemctl stop firewalld
setenforce 0
二、在MASTER、BACKUP
安装keepalived
yum -y install keepalived ipvsadm
修改配置文件
vim /etc/keepalived/keepalived.conf
############################
! Configuration File for keepalived
global_defs {
notification_email {br/>acassen@firewall.loc
failover@firewall.locbr/>sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_strict #删除此行
vrrp_skip_check_adv_addr
vrrp_garp_interval 0
vrrp_gna_interval 0
}
vrrp_instance VI_1 {
state MASTER #从服务器改为BACKUP
interface eno16777736 #改为本机网卡名
virtual_router_id 51
priority 100 #MASTER大于BACKUP
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.124.100 #设置VIP
}
}
########################################
三、起启动并检测
systemctl start keepalived
ip a
MASTER 存在 VIP BACKUP没有VIP
MASTER上关闭keepalived
systemctl stop keepalived
ip a
MASTER 上没有VIP BACKUP 上存在VIP
标签:没有 address email auth 网卡名 serve 两台 failover 文件
原文地址:https://blog.51cto.com/14375805/2442994