Keepalived 找不到我的介面之一

Keepalived 找不到我的介面之一

我剛剛安裝了一台新伺服器(Ubuntu 14.04)來開始測試我們的 keepalived 配置,該配置在(Ubuntu 12.04)上運行良好

我們不在 eth1 介面上分配公用 IP,我們允許 keepalived 這樣做以在我們的環境中保留公用 IP。

這適用於 12.04 伺服器

/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address x.x.x.x
    netmask x.x.x.x

auto eth1
iface eth1 inet static

/etc/keepalived/keepalived.conf

vrrp_script chk_haproxy {
  script    "/usr/bin/killall -0 haproxy"
  interval  2
  weight    
}

vrrp_script chk_stunnel {
  script    "/usr/bin/killall -s 0 -r 'stunnel[4]?'"
  interval  2
  weight    
}

global_defs {
  notification_email {
    [email protected]
  }
  notification_email_from [email protected]
  smtp_server x.x.x.x
  smtp_connect_timeout 30
  router_id somehost
}

vrrp_instance VI_01 {
  interface                 eth0
  state                     MASTER
  virtual_router_id         1
  priority                  150
  advert_int                1
  garp_master_delay         5
  smtp_alert



  # notify scripts and alerts are optional
  #
  # filenames of scripts to run on transitions
  # can be unquoted (if just filename)
  # or quoted (if has parameters)
  # to MASTER transition
  notify_master "/sbin/route del default gw x.x.x.x"
  # to BACKUP transition
  notify_backup "/sbin/route add default gw x.x.x.x"




  authentication {
    auth_type PASS
    auth_pass somepas
  }

  track_script {
    chk_stunnel
    chk_haproxy
  }


  virtual_ipaddress {
    x.x.x.x/x dev eth1
  }


  virtual_routes {
    default via x.x.x.x dev eth1  
  }



}

然而,在 14.04 系統上,當透過複製和貼上(僅修改新子網路的 IP)進行部署時,keepalived 表示介面佇列為空,並將聲明 eth1 為缺失介面。

這是 Ubuntu 14.04 中 ipvs 行為的改變嗎?沒有 IP 的介面會不再可用嗎?

相關內容