两台使用 CARP + LAGG 的 BSD 服务器,两台服务器都是 MASTER,无法将辅助服务器降级为 STANDBY

两台使用 CARP + LAGG 的 BSD 服务器,两台服务器都是 MASTER,无法将辅助服务器降级为 STANDBY

两台具有通用地址冗余协议 (CARP) 的 BSD 服务器配置为使用链路聚合 (LAGG) 在接口上运行。两台服务器都是 CARP MASTER,我似乎无法将其中一台降级为 STANDBY。我可以手动强制第二台服务器进入待机状态,但它会在几秒钟内恢复为主服务器。我使用“tcpdump”并看到来自两台服务器的大量 CARP keepalive 都到达了两台服务器。

有人让这个工作吗?有什么窍门呢?

这是来自 stackoverflow 的交叉发布 - 也许这是解决这个问题的更好网站。

服务器1(应该是主服务器)

   $ ifconfig lagg0
   lagg0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
           options=e507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM, \
                 TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
           ether 00:25:90:e9:d5:74
           inet 111.222.333.83 netmask 0xfffffff0 broadcast 104.225.9.95
           inet 111.222.333.84 netmask 0xffffffff broadcast 104.225.9.84 vhid 1
           inet 111.222.333.85 netmask 0xffffffff broadcast 104.225.9.85 vhid 3
           inet 101.24.0.83 netmask 0xffffffff broadcast 10.242.0.83
           inet6 fe80::225:90ff:fee9:d574%lagg0 prefixlen 64 scopeid 0x4
           inet6 2607:fc50:3000:4::83 prefixlen 64
           inet6 2607:fc50:3000:4::84 prefixlen 64 vhid 2
           inet6 2607:fc50:3000:4::85 prefixlen 64 vhid 4
           laggproto lacp lagghash l2,l3,l4
           laggport: igb0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
           laggport: igb1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
           groups: lagg
           carp: MASTER vhid 1 advbase 1 advskew 100
           carp: MASTER vhid 3 advbase 1 advskew 0
           carp: MASTER vhid 2 advbase 1 advskew 100
           carp: MASTER vhid 4 advbase 1 advskew 0
           media: Ethernet autoselect
           status: active
           nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

   $ sysctl -a | egrep 'lagg|carp'
          net.inet.carp.ifdown_demotion_factor: 240
          net.inet.carp.senderr_demotion_factor: 240
          net.inet.carp.demotion: 0
          net.inet.carp.log: 1
          net.inet.carp.preempt: 1
          net.inet.carp.dscp: 56
          net.inet.carp.allow: 1
          net.link.lagg.lacp.default_strict_mode: 1
          net.link.lagg.lacp.debug: 0
          net.link.lagg.default_flowid_shift: 16
          net.link.lagg.default_use_flowid: 0
          net.link.lagg.failover_rx_all: 0

服务器2(应该是备用)

   lagg0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
           options=e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4, \
                 TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
           ether 78:45:c4:fa:d2:99
           inet 111.222.333.82 netmask 0xfffffff0 broadcast 104.225.9.95
           inet 111.222.333.84 netmask 0xffffffff broadcast 104.225.9.84 vhid 1
           inet 111.222.333.85 netmask 0xffffffff broadcast 104.225.9.85 vhid 3
           inet 101.24.0.82 netmask 0xffffffff broadcast 10.242.0.82
           inet6 fe80::7a45:c4ff:fefa:d299%lagg0 prefixlen 64 scopeid 0x4
           inet6 2607:fc50:3000:4::82 prefixlen 64
           inet6 2607:fc50:3000:4::84 prefixlen 64 vhid 2
           inet6 2607:fc50:3000:4::85 prefixlen 64 vhid 4
           laggproto lacp lagghash l2,l3,l4
           laggport: igb0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
           laggport: igb1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
           groups: lagg
           carp: MASTER vhid 1 advbase 1 advskew 200
           carp: MASTER vhid 3 advbase 1 advskew 200
           carp: MASTER vhid 2 advbase 1 advskew 100
           carp: MASTER vhid 4 advbase 1 advskew 0
           media: Ethernet autoselect
           status: active
           nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

   sysctl -a | egrep 'lagg|carp'
           <6>[26809290] carp: 3@lagg0: MASTER -> BACKUP (user requested via ifconfig)
           <6>[26809290] lagg0: deletion failed: 3
           <6>[26809294] carp: 3@lagg0: BACKUP -> MASTER (master timed out)
           <6>[26809296] carp: 1@lagg0: MASTER -> BACKUP (user requested via ifconfig)
           <6>[26809296] lagg0: deletion failed: 3
           <6>[26809300] carp: 1@lagg0: BACKUP -> MASTER (master timed out)
           net.inet.carp.ifdown_demotion_factor: 240
           net.inet.carp.senderr_demotion_factor: 240
           net.inet.carp.demotion: 0
           net.inet.carp.log: 1
           net.inet.carp.preempt: 1
           net.inet.carp.dscp: 56
           net.inet.carp.allow: 1
           net.link.lagg.lacp.default_strict_mode: 1
           net.link.lagg.lacp.debug: 0
           net.link.lagg.default_flowid_shift: 16
           net.link.lagg.default_use_flowid: 0
           net.link.lagg.failover_rx_all: 0

答案1

请检查防火墙规则。必须在此网络(这些主机之间)启用 CARP 协议。

相关内容