主
1.安装
[root@ c7-41 ~]# yum -y install keepalived
2.修改配置文件
[root@ c7-41 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER #备
interface ens33 #端口
virtual_router_id 51
priority 100 #优先级
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.100 #vip
}
}
3.启动
[root@ c7-41 ~]# systemctl start keepalived
4.查看
[root@ c7-41 ~]# ip a
从
1.安装
[root@ c7-41 ~]# yum -y install keepalived
2.修改配置文件
[root@ c7-41 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state BACKUP #备
interface ens33 #端口
virtual_router_id 51
priority 90 #优先级
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.100 #vip
}
}
3.启动
[root@ c7-41 ~]# systemctl start keepalived
4.查看
[root@ c7-41 ~]# ip a