(1)、master配置

! Configuration File for keepalived

global_defs {
   router_id lb01
}

vrrp_script check_ng {
    script "/etc/keepalived/check_keepalived.sh"
    interval 2
    weight -5
    fall 3
    rise 2
}

vrrp_instance VI_1 {
    state BACKUP                      # 主上也设置为备
    interface ens33
    virtual_router_id 51
    priority 150
    advert_int 1
    nopreempt                           # 设置为不抢夺VIP
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.169.200
    }
    track_script {
        check_ng
    }
}

(2)、slave配置

! Configuration File for keepalived

global_defs {
   router_id lb02
}

vrrp_script check_ng {
    script "/etc/keepalived/check_keepalived.sh"
    interval 2
    weight -5
    fall 3
    rise 2
}

vrrp_instance VI_1 {
    state BACKUP
    interface ens33
    virtual_router_id 51
    priority 149 
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass 1111
    
    virtual_ipaddress {
        192.168.169.200
    }
    track_script {
        check_ng
    }
}

相关文章:

  • 2021-06-20
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2022-01-10
猜你喜欢
  • 2021-09-09
  • 2021-12-03
  • 2021-08-07
  • 2021-07-26
  • 2021-11-17
  • 2021-06-24
  • 2022-01-15
相关资源
相似解决方案