MENU

keepalived VRRP主备冗余服务

vip地址

主机a=192.168.100.10
主机b=192.168.100.11
vip地址=192.168.100.15

部署

yum install keepalived -y

主机A

cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived
global_defs {
   router_id lb01
}

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

主机B

cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived
global_defs {
   router_id lb02
}

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

启动服务

service keepalived start

参考:https://www.cnblogs.com/clsn/p/8052649.html

Tags: None
Archives QR Code
QR Code for this page
Tipping QR Code
Leave a Comment