posts - 68, comments - 19, trackbacks - 0, articles - 1

keepalived高可用配置

Posted on 2018-09-16 15:35 viery 阅读(103) 评论(0)  编辑  收藏
主机: 1 [root@c01 etc]# cat /etc/keepalived/keepalived.conf 
 2 ! Configuration File for keepalived
 3 
 4 global_defs {
 5    notification_email {
 6     15776275@qq.com
 7    }
 8    notification_email_from Alexandre.Cassen@firewall.loc
 9    smtp_server 127.0.0.1
10    smtp_connect_timeout 30
11    router_id c01
12 }
13 
14 vrrp_instance VI_1 {
15     state MASTER
16     interface eth0
17     virtual_router_id 55
18     priority 150
19     advert_int 1
20     authentication {
21         auth_type PASS
22         auth_pass 1111
23     }
24     virtual_ipaddress {
25         192.168.38.166/24 dev eth0 label eth0:1
26     }
27 }


备用机:
[root@c01 etc]# cat /etc/keepalived/keepalived.conf 
! Configuration File for keepalived

global_defs {
   notification_email {
    15776275@qq.com
   }
   notification_email_from Alexandre.Cassen@firewall.loc
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id c04
}

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 55
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.38.166/24 dev eth0 label eth0:1
    }
}

只有注册用户登录后才能发表评论。


网站导航: