安装
yum install keepalived
修改配置文件
cd /etc/keepalived/ vim keepalived.conf
systemctl enable keepalived systemctl start keepalived
[root@ops-83 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
wanghui3w@139.com
}
notification_email_from wanghui3w@139.com
smtp_server smtp.139.com
smtp_connect_timeout 30
router_id NGINX_UPSTREAM
}
vrrp_instance VI_1 {
state MASTER
interface eno16777984
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1346
}
virtual_ipaddress {
192.168.0.123
}
}
[root@ops-83 ~]#