问题现象
03月13日Oracle RAC启动失败



共享存储状态 分析
未见异常

DNS状态分析
未见异常

防火墙状态分析
未见异常


私网状态分析
可以通信 MTU 为 8972 的包,排除两边主机 MTU 不一致的情况



bash
附上测试的命令行(不是本次测试结果)
测试 9000 MTU - 失败
[grid@orcl01:/home/grid]$ ping 1.1.1.2 -c 3 -M do -s 8972
PING 1.1.1.2 (1.1.1.2) 8972(9000) bytes of data.
^C
--- 1.1.1.2 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1021ms
测试 1500 MTU - 成功
[grid@orcl01:/home/grid]$ ping 1.1.1.2 -c 3 -M do -s 1472
PING 1.1.1.2 (1.1.1.2) 1472(1500) bytes of data.
1480 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.177 ms
1480 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=0.127 ms
^C
--- 1.1.1.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1032ms
rtt min/avg/max/mdev = 0.127/0.152/0.177/0.025 ms
crsd启动分析
crsctl start res ora.crsd -init 发现报错,疑似通信问题


网络状态分析
Oracle RAC 私网默认主要走 UDP,但 Clusterware 心跳/管理面会用到 TCP,实际是 UDP 为主、TCP 为辅。
| 流量类型 | 协议 | 说明 |
|---|---|---|
| Cache Fusion(数据块、锁、GCS/GES) | UDP | RAC 实例间缓存融合流量默认走 UDP,11.2+ 通常经 HAIP 169.254.x.x 传输 HAIP(169.254.x.x)地址通信失败也会表现为 ASM 启动卡住,但它同样走 UDP 动态端口,不是 1521 |
| Clusterware 心跳、CSSD、gipcd | UDP + TCP | CSSD 心跳、gipcd 探测等会用到 UDP 和 TCP 例如 19c 默认有 TCP 2016(GIPCD 心跳探测端口,19c 默认启用,不可改) UDP 全端口双向通行(cssd、ohasd、oraagent 均动态绑定) |
| 防火墙/安全组 | UDP 全端口 + TCP 2016 + ICMP | 不能只开 1521;UDP 端口是动态的,建议私网 CIDR 双向放行 UDP 0-65535 |
运维排查要点
bash
抓包优先盯 UDP:Cache Fusion 流量在私网上表现为 UDP 包,排查 GC 延迟/丢包时 tcpdump 要按 HAIP + UDP 过滤。
UDP 丢包不重传:和 TCP 不同,UDP 丢包后 Oracle 不靠协议层重传,会直接表现为 gc cr block lost、gc buffer busy 飙升,所以私网 UDP buffer 和 MTU 很关键。
MTU 两端+交换机必须一致:建议统一开 Jumbo Frame(MTU 9000),否则 UDP 分片重组失败会导致静默丢包甚至节点驱逐。
Exadata / InfiniBand 场景:可能走 RDS 协议,不再是普通 UDP/IP,这种环境下排查路径和普通以太私网不一样。
一句话:普通以太私网环境,Cache Fusion 走 UDP;Clusterware 心跳和探测会混用 TCP/UDP;防火墙必须同时放通 UDP 全端口和 TCP 2016。
netstat -s udp部分
节点二 大量timeout

节点一 大量timeout

系统内核参数分析
发现不是官方推荐的网卡通信参数,修改后RAC正常启动

bash
rp_filter (Reverse Path Filtering)参数定义了网卡对接收到的数据包进行反向路由验证的规则。它有三个值,0、1、2,具体含义如下:
0:关闭反向路由校验
1:开启严格的反向路由校验。对每个进来的数据包,校验其反向路由是否是最佳路由。如果反向路由不是最佳路由,则直接丢弃该数据包。
2:开启松散的反向路由校验。对每个进来的数据包,校验其源地址是否可达,即反向路由是否能通(通过任意网口),如果反向路径不通,则直接丢弃该数据包。
默认值是 1.
ocssd.trc报has a disk HB, but no network HB
Oracle安装文档上也有相关解释:
Multiple Private Interconnects and Oracle Linux
Without these rp_filter parameter settings systems, interconnect packets can be blocked or discarded.
The rp_filter values set the Reverse Path filter to no filtering (0), to strict filtering (1), or to loose filtering (2). Set the rp_filter value for the private interconnects to either 0 or 2. Setting the private interconnect NIC to 1 can cause connection issues on the private interconnect. It is not considered unsafe to disable or relax this filtering, because the private interconnect should be on a private and isolated network.
For example, where eth1 and eth2 are the private interconnect NICs, and eth0 is the public network NIC, set the rp_filter of the private address to 2 (loose filtering), the public address to 1 (strict filtering), using the following entries in /etc/sysctl.conf:
net.ipv4.conf.eth2.rp_filter = 2
net.ipv4.conf.eth1.rp_filter = 2
net.ipv4.conf.eth0.rp_filter = 1
分析总结
综合上述分析,我们可以看到:
Oracle RAC启动失败,是由于私网通信失败引起。
处理/优化建议
针对现有情况,建议如下:
-
对于 Bond 网卡,使用主备模式
-
交换机和主机网卡 MTU 保持一致
-
对于 team 网卡,调整系统内核参数(反向路径过滤)