码迷,mamicode.com
首页 > 其他好文 > 详细

keepalived-master-slave

时间:2021-04-27 14:42:00      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:not   type   style   pass   ESS   color   roo   ict   glob   

Master配置

global_defs {
   notification_email {
     root@localhost   
      }  
   notification_email_from keeplived@localhost
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id test1
   vrrp_skip_check_adv_addr
   vrrp_garp_interval 0 
   vrrp_gna_interval 0 
   vrrp_mcast_group4 224.0.0.18 
}
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100 
    advert_int 1 
    authentication {  
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
            10.211.55.99
    }
}  

 

Backup配置

global_defs {
   notification_email {
     root@localhost   
      }  
   notification_email_from keeplived@localhost
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id test1
   vrrp_skip_check_adv_addr
   vrrp_garp_interval 0 
   vrrp_gna_interval 0 
   vrrp_mcast_group4 224.0.0.18 
}
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 51
    priority 50
    advert_int 1 
    authentication {  
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
            10.211.55.99
    }
}  

抢占模式

抢占延迟模式,即优先级高的主机恢复后,不会立即抢回IP,而是延迟一段时间,默认300s 再抢回

preempt_delay 30

注意:需要各keepalived服务器state为backup,并且不要启用vrrp_strict

ha1(原来主)
state=BACKUP
preempt_delay 30

 

keepalived-master-slave

标签:not   type   style   pass   ESS   color   roo   ict   glob   

原文地址:https://www.cnblogs.com/huakai201/p/14705700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!