RHCS configure transport = (udp udpb udp rdma) in cluster.conf 's cman

简介:
       transport
              This directive controls the transport mechanism used.  If the inter-
              face to which corosync is binding is an RDMA interface such as RoCEE
              or Infiniband, the "iba" parameter may be specified.  To  avoid  the
              use  of multicast entirely, a unicast transport parameter "udpu" can
              be specified.  This requires specifying the  list  of  members  that
              could potentially make up the membership before deployment.

              The  default  is udp.  The transport type can also be set to udpu or
              iba.

              Within the totem directive, there are several configuration  options
              which are used to control the operation of the protocol.  It is gen-
              erally not recommended to change any of these values without  proper
              guidance  and  sufficient testing.  Some networks may require larger
              values if suffering from frequent reconfigurations.   Some  applica-
              tions  may  require  faster  failure  detection  times  which can be
              achieved by reducing the token timeout.

我们在使用RHCS做集群时, 心跳包默认是通过多播发送的, 多播地址是通过集群ID来计算的.
如果你的环境不支持多播(udp), 那么可以选择广播(udpb)或单播(udpu), 或者你有infiniband设备的话, 可以选择(rdma)
配置可参考 :
/usr/share/cluster/cluster.rng

非常详细.

例如, 默认是多播的. 我们在启动CMAN服务后, 可以看到多播地址以及监听端口.
# netstat -anp|grep corosync
udp        0      0 10.10.10.154:5404           0.0.0.0:*                               11937/corosync      
udp        0      0 10.10.10.154:5405           0.0.0.0:*                               11937/corosync      
udp        0      0 239.192.70.113:5405         0.0.0.0:*                               11937/corosync

同时我们可以使用TCPDUMP观察到心跳包是通过多播来发送的.
# tcpdump -i eth0 'ip[16] >=224'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:01:24.609140 IP 10.10.10.154.hpoms-dps-lstn > 239.192.70.113.netsupport: UDP, length 119
15:01:26.512234 IP 10.10.10.154.hpoms-dps-lstn > 239.192.70.113.netsupport: UDP, length 119
15:01:28.415854 IP 10.10.10.154.hpoms-dps-lstn > 239.192.70.113.netsupport: UDP, length 119


如果要改成单播, 需要改cman, 添加一个参数transport, 使用udpu的值. 注意不要忘记改配置的版本号.
# vi /etc/cluster/cluster.conf
<cluster config_version="23" name="digoal_pg001">
  <cman expected_votes="1" two_node="1" transport="udpu"/>

重启cman服务后, 可以看到没有多播的监听地址了, 现在使用了单播监听UDP, 端口也变了.
# netstat -anp|grep corosync
udp        0      0 10.10.10.154:5405           0.0.0.0:*                               16222/corosync      
udp        0      0 10.10.10.154:46015          0.0.0.0:*                               16222/corosync      
udp        0      0 10.10.10.154:9318           0.0.0.0:*                               16222/corosync 

观测不到多播包.
# tcpdump -i eth0 'ip[16] >=224'

可以看到心跳包走单播了
# tcpdump -i eth0 |grep 10.10.10.221
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:22:38.731769 IP 10.10.10.154.netsupport > 10.10.10.221.netsupport: UDP, length 107
15:22:38.732357 IP 10.10.10.221.netsupport > 10.10.10.154.netsupport: UDP, length 107
15:22:38.941722 IP 10.10.10.154.secure-ts > 10.10.10.221.netsupport: UDP, length 119
15:22:40.636224 IP 10.10.10.154.netsupport > 10.10.10.221.netsupport: UDP, length 107
15:22:40.636911 IP 10.10.10.221.netsupport > 10.10.10.154.netsupport: UDP, length 107
15:22:40.846299 IP 10.10.10.154.secure-ts > 10.10.10.221.netsupport: UDP, length 119
15:22:42.540841 IP 10.10.10.154.netsupport > 10.10.10.221.netsupport: UDP, length 107
15:22:42.541616 IP 10.10.10.221.netsupport > 10.10.10.154.netsupport: UDP, length 107
15:22:42.750954 IP 10.10.10.154.secure-ts > 10.10.10.221.netsupport: UDP, length 119


[参考]
1. /usr/share/cluster/cluster.rng
    <optional>
     <attribute name="transport" rha:description="Specifies transport mechanism to use. Available values are udp (multicast default), udpb (broadcast), udpu (unicast) and rdma (Infiniband).  corosync.conf(5)" rha:sample="">
     <choice>
       <value>udp</value>
       <value>udpb</value>
       <value>udpu</value>
       <value>rdma</value>
      </choice>
     </attribute>
    </optional>


2. man corosync.conf
相关文章
|
23天前
|
存储 传感器 网络协议
通信协议缓冲区管理全景:TCP、UDP、ZMQ、DBus、SSL、SOME/IP通讯协议的缓冲区解析...
通信协议缓冲区管理全景:TCP、UDP、ZMQ、DBus、SSL、SOME/IP通讯协议的缓冲区解析...
64 0
|
2月前
|
Kubernetes 网络协议 Linux
Cilium 系列 -10- 启用 IPv6 BIG TCP 和启用巨帧
Cilium 系列 -10- 启用 IPv6 BIG TCP 和启用巨帧
|
9月前
|
网络协议 应用服务中间件 nginx
Nginx TCP 端口转发
Nginx TCP 端口转发
128 0
|
网络协议
TCP server
TCP server
74 0
|
网络协议 JavaScript
nodejs TCP server和TCP client如何进行数据交互
nodejs TCP server和TCP client如何进行数据交互
105 0
nodejs TCP server和TCP client如何进行数据交互
|
负载均衡 网络协议 算法
我个人的Haproxy-1.7.9实践:安装,编译与测试(1)(★firecat推荐,针对TCP四层负载均衡★)
我个人的Haproxy-1.7.9实践:安装,编译与测试(★firecat推荐,针对TCP四层负载均衡★)
216 0
我个人的Haproxy-1.7.9实践:安装,编译与测试(1)(★firecat推荐,针对TCP四层负载均衡★)
|
负载均衡 监控 网络协议
我个人的Haproxy-1.7.9实践:安装,编译与测试(2)(★firecat推荐,针对TCP四层负载均衡★)
我个人的Haproxy-1.7.9实践:安装,编译与测试(★firecat推荐,针对TCP四层负载均衡★)
218 0
我个人的Haproxy-1.7.9实践:安装,编译与测试(2)(★firecat推荐,针对TCP四层负载均衡★)
|
网络协议 关系型数据库 Linux
PostgreSQL pgsocket: Extension for Simple TCP/IP Socket Client
标签 PostgreSQL , pgsocket 背景 PostgreSQL 插件,向外部tpc/ip socket服务发生字节流。 pgsocket is an extension for PostgreSQL server to send bytes to remote TCP/IP socket server.
812 0