keepalived抢占模式

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
原创文章 96 获赞 4 访问量 2188

猜你喜欢

转载自blog.csdn.net/weixin_46380571/article/details/105680343