美文网首页
keepalived环境部署

keepalived环境部署

作者: Jzyue | 来源:发表于2019-08-04 09:41 被阅读0次

    一、软件安装

    yum install -y keepalived

    二、查询已安装的软件及路径

    rpm -qc keepalived
    /etc/keepalived/keepalived.conf
    /etc/sysconfig/keepalived

    三、配置抢占式高可用

    抢占式主配置
    vim /etc/keepalived/keepalived.conf
    global_defs {
    router_id keepalived01
    }

    vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 50
    priority 150
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    10.0.0.3
    }
    }

    抢占式备配置
    vim /etc/keepalived/keepalived.conf
    global_defs {
    router_id keepalived02
    }

    vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 100
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    10.0.0.3
    }
    }

    四、配置非抢占式高可用

    非抢占式主配置
    vim /etc/keepalived/keepalived.conf
    global_defs {
    router_id keepalived01
    }

    vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 150
    nopreempt
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    10.0.0.3
    }
    }

    非抢占式备配置
    vim /etc/keepalived/keepalived.conf
    global_defs {
    router_id keepalived02
    }

    vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 100
    nopreempt
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    10.0.0.3
    }
    }

    相关文章

      网友评论

          本文标题:keepalived环境部署

          本文链接:https://www.haomeiwen.com/subject/qnuedctx.html