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.
AI 代码解读

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

非常详细.

例如, 默认是多播的. 我们在启动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
AI 代码解读

同时我们可以使用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
AI 代码解读


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

重启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 
AI 代码解读

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

可以看到心跳包走单播了
# 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
AI 代码解读


[参考]
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>
AI 代码解读


2. man corosync.conf
目录
打赏
0
0
0
0
20702
分享
相关文章
|
7月前
|
ClickHouse安装教程:开启你的列式数据库之旅
ClickHouse 是一个高性能的列式数据库管理系统,适用于在线分析处理(OLAP)。本文介绍了 ClickHouse 的基本使用步骤,包括下载二进制文件、安装应用、启动服务器和客户端、创建表、插入数据以及查询新表。还提到了图形客户端 DBeaver 的使用,使操作更加直观。通过这些步骤,用户可以快速上手并利用 ClickHouse 的强大性能进行数据分析。
585 4
AIGC对新闻伦理的冲击以及应对
【1月更文挑战第10天】AIGC对新闻伦理的冲击以及应对
489 1
AIGC对新闻伦理的冲击以及应对
顶顶通呼叫中心中间件介绍
顶顶通呼叫中心中间件包含IPPBX、自动外呼、质检、ACD、呼叫路由等呼叫中心功能,也包含电话机器人开发接口(ASR【对接了华为云,腾讯云,科大讯飞,阿里云,捷通华声等,mrcp等语音识别接口】,TTS【支持外呼时预先文字转换成声音和mrcp实时TTS】,VAD【集成噪音人声识别引擎】),话术引擎等ai机器人功能。所有数据都存储redis【话单可以存储到数据库】,支持群集,超大并发,可用于开发呼叫中心系统,智能外呼机器人系统,机器人客服系统。
467 62
基于Docker搭建ELK(Elasticsearch、Logstash、Kibana)
ELK是一套强大的开源工具组合,可以帮助我们采集、存储、分析和可视化大量的日志数据,本文通过简明清晰的步骤指导,帮助读者快速搭建起基于Docker的ELK日志分析平台,为日志数据的收集、存储、分析和可视化提供了一种高效可靠的解决方案。
《微服务治理技术白皮书》电子版和音频版地址
《微服务治理技术白皮书》由阿里云云原生微服务团队编著,筹备近半年多的,长达 379 页。
141 0
《微服务治理技术白皮书》电子版和音频版地址
【Java】(萌新必看) 数据类型与运算符 !!
变量指的是程序运行时可变的量. 相当于开辟一块内存空间来保存一些数据.
244 0
【Java】(萌新必看) 数据类型与运算符 !!
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等