Amazon-Web-Services

corosync 1.4 是否支持公共 IP?

  • October 21, 2016

我正在創建一個基於雲的集群,所以現在我使用單播連接到其他起搏器/corosync 節點。我能夠使用私有 IP 創建一個集群。要創建跨區域集群,我想使用公共 IP。我嘗試使用通用配置,為 memberaddr 提供公共 IP,為 bindnetaddr 提供節點的公共 IP。像這樣的東西

 interface {

          member {
            memberaddr: <public ip 1>
          }
          member {
             memberaddr: <public ip 2>
          }
          member {
             memberaddr: <public ip 3>
          }
          ringnumber: 0
          bindnetaddr: <current nodes public Ip>
          mcastport: 5405
          ttl: 1
 }
 transport: udpu

這是行不通的。難道我做錯了什麼 ?我能找到的所有參考資料都是 corosync 2.x

謝謝

我幾乎忘記了這一點,如果有人試圖讓 corosync 1.4 在具有公共 IP 的雲上工作。Corosync 根據您提供的綁定地址綁定到介面,並生成一個綁定地址,該地址將是您的介面地址。

據我了解,它是將這個 IP 廣播給所有節點,這些節點反過來響應這個地址,而不是它接收數據包的地址。

因此,如果您的公共 IP 不像在某些雲上那樣在盒子上,那麼可能無法像公共 IP 一樣使用 Corosync

如果 Corosync 配置適用於您的專用網路,它也應該適用於您的公共網路。我將驗證是否存在允許 UDP 埠 5404 和 5405 在節點之間通信的防火牆規則。

此外,bindnetaddr不一定是 IP 地址;它正在尋找一個網路地址。只需確定您為網路遮罩使用了正確的網路地址。

從 Corosync.conf 手冊頁:

bindnetaddr
         This specifies the network address the corosync executive should
         bind to.

         bindnetaddr should be an IP address configured on the system, or
         a network address.

         For example, if the local interface is 192.168.5.92 with netmask
         255.255.255.0, you should set  bindnetaddr  to  192.168.5.92  or
         192.168.5.0.   If  the local interface is 192.168.5.92 with net‐
         mask  255.255.255.192,  set  bindnetaddr  to   192.168.5.92   or
         192.168.5.64, and so forth.

         This  may also be an IPV6 address, in which case IPV6 networking
         will be used.  In this case, the exact address must be specified
         and  there  is  no  automatic selection of the network interface
         within a specific subnet as with IPv4.

         If IPv6 networking is used, the nodeid field in nodelist must be
         specified.

引用自:https://serverfault.com/questions/808496