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
目录
相关文章
|
存储 缓存 Oracle
Oracle JDBC 驱动程序
开始使用 Oracle JDBC 驱动程序 (Doc ID 1602866.1
2486 0
|
Python
Python 3.5 RuntimeError: can&#39;t start new thread
/*********************************************************************** * Python 3.5 RuntimeError: can't start new thread * 说明: * 测试的时候线程开得太多了,导致软件开始,不再能够被处理,卡死。
6883 0
|
11月前
|
SQL Unix OLAP
ClickHouse安装教程:开启你的列式数据库之旅
ClickHouse 是一个高性能的列式数据库管理系统,适用于在线分析处理(OLAP)。本文介绍了 ClickHouse 的基本使用步骤,包括下载二进制文件、安装应用、启动服务器和客户端、创建表、插入数据以及查询新表。还提到了图形客户端 DBeaver 的使用,使操作更加直观。通过这些步骤,用户可以快速上手并利用 ClickHouse 的强大性能进行数据分析。
1261 4
|
分布式计算 关系型数据库 MySQL
使用 PySpark 读取csv数据进行分析,将结果数据导入招聘数据
使用 PySpark 读取csv数据进行分析,将结果数据导入招聘数据
276 2
|
人工智能 小程序 搜索推荐
【利用AI让知识体系化】从理论层面了解微信小程序(二)
【利用AI让知识体系化】从理论层面了解微信小程序
|
存储 机器学习/深度学习 人工智能
顶顶通呼叫中心中间件介绍
顶顶通呼叫中心中间件包含IPPBX、自动外呼、质检、ACD、呼叫路由等呼叫中心功能,也包含电话机器人开发接口(ASR【对接了华为云,腾讯云,科大讯飞,阿里云,捷通华声等,mrcp等语音识别接口】,TTS【支持外呼时预先文字转换成声音和mrcp实时TTS】,VAD【集成噪音人声识别引擎】),话术引擎等ai机器人功能。所有数据都存储redis【话单可以存储到数据库】,支持群集,超大并发,可用于开发呼叫中心系统,智能外呼机器人系统,机器人客服系统。
593 91
|
人工智能 开发者
AIGC对新闻伦理的冲击以及应对
【1月更文挑战第10天】AIGC对新闻伦理的冲击以及应对
657 1
AIGC对新闻伦理的冲击以及应对
|
前端开发 程序员
前端开发:遇到This relative module was not found 的解决方法
在前端开发的时候,会遇到因为引入的文件路径不正确而造成的报错问题,这类问题在前端开发过程中很常见,但是还是会遇到不少坑。那么本文就来分享一个关于在前端开发过程中遇到This relative module was not found 的报错的解决方法。
1219 0
前端开发:遇到This relative module was not found 的解决方法
|
Linux 数据安全/隐私保护
CentOS 6.x 单用户模式重置root密码
CentOS 6.x 单用户模式重置root密码
1252 0
|
数据安全/隐私保护
centOS6用户修改密码
centOS6用户修改密码
632 0