您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

一次RAC VIP漂移的结果诊断及修复

2024/6/27 13:14:53发布35次查看
背景概述 客户的10g数据库vip出现宕,引起vip负载到另一个节点 事件支持细节 04:29:56.378 一号机器vip 出现 went offline unexp
背景概述
客户的10g数据库vip出现宕,引起vip负载到另一个节点
事件支持细节
04:29:56.378 一号机器vip 出现 went offline unexpectedly,当天出现这个vip漂移的故障后为检查vip宕掉的原因,
对vip资源启动debug 5模式:./crsctl debug log res orahostname1.vip:5
04:38:36.047 一号节点vip 出现 went offline unexpectedly。
根据ora.hostname.vip.log日志显示,出现vip宕原因基本可以确定为公网ip与缺省网管通讯不畅引起。
根据oracle管方建议,调整racgvip程序中的参数从    fail_when_defaultgw_no_found=1 修改成
fail_when_defaultgw_no_found=0
但是调整完后故障依旧
04:17:37.822: [  crsres][11025]32ora.hostname1.vip on hostname1 went offline unexpectedly
 为明确原因,再次收集ora.hostname1.vip.log及racgvip 信息进行分析
分析结果如下:
在racgvip程序中,有如下代码
# check the status of the interface thro' pinging gateway
if [ -n $defaultgw ]
then
_ret=1
# get base ip address of the interface
tmpip=`$lsattr -el ${_if} -a netaddr | $awk '{print $2}'`
# get rx packets numbers (bug8341569,9157855->bug9743421)
_o1=`$netstat -n -i $_if | $awk { if (/^$_if/) {print \\$(nf-4); exit}}`
x=$check_times
while [ $x -gt 0 ]
do
if [ -n $tmpip ]
then
logx about to execute command: $ping -s $tmpip $ping_timeout $defaultgw
$ping -s $tmpip $ping_timeout $defaultgw > /dev/null 2>&1
else
logx about to execute command: $ping $ping_timeout $defaultgw
$ping $ping_timeout $defaultgw > /dev/null 2>&1
fi
_o2=`$netstat -n -i $_if | $awk { if (/^$_if/) {print \\$(nf-4); exit}}`
if [ $_o1 != $_o2 ]
then
# rx packets numbers changed
_ret=0
break
fi
$sleep 1
x=`$expr $x - 1`
done
if [ $_ret -ne 0 ]
then
logx isifalive: rx packets checked if=$_if failed
else
logx isifalive: rx packets checked if=$_if ok
fi
else
logx isifalive: default gateway is not defined (host=$hostname)
if [ $fail_when_defaultgw_no_found -eq 1 ]
then
_ret=1
else
_ret=0
fi
fi
从源码我们可以看到检查缺省网关的处理逻辑
1、如果检测到缺省网关存在执行网管检查逻辑
2、_01收集网卡网络包量
3、$ping -s $tmpip $ping_timeout $defaultgw  ping网管
4、_02再次收集网卡网络包量
5、如果_01网卡网络包量 与 _02网卡网络包量不相同,表明网卡与缺省网卡之间通讯正常 _ret 返回编码为0
6、如果_01网卡网络包量 与 _02网卡网络包量相同,_ret 返回编码没指定,缺省返回1,同时打印日志logx isifalive: rx packets checked if=$_if failed,即判断网卡失败。
 fail_when_defaultgw_no_found参数从1修改成0,是为了跳过网关ping检测,而从源码中我们可以看到,fail_when_defaultgw_no_found参数只有在网卡参数$defaultgw为空才生效,即主机上没有配置网关并且参数fail_when_defaultgw_no_found配置为非1时返回码ret为0。
由于我们的环境中defaultgw能获取成功及defaultgw非空,导致程序没有进入fail_when_defaultgw_no_found判断是否为1的处理流程。
故障期间debug错误信息如下:
2013-11-06 04:17:37.776: [    racg][1] [18219068][1][ora.s9lp1.vip]: wed nov  6 04:17:33 cst 2013 [ 6422696 ] checkif: start for if=en5
wed nov  6 04:17:33 cst 2013 [ 6422696 ] isifalive: start for if=en5
wed nov  6 04:17:33 cst 2013 [ 6422696 ] defaultgw:  started
2013-11-06 04:17:37.776: [    racg][1] [18219068][1][ora.s9lp1.vip]: wed nov  6 04:17:33 cst 2013 [ 6422696 ] defaultgw:  completed with 10.0.241.254  (网关获取成功,网关为10.0.241.254)
wed nov  6 04:17:33 cst 2013 [ 6422696 ] about to execute command: /usr/sbin/ping -s 10.0.241.150  -c 1 -w 1 10.0.241.254
2013-11-06 04:17:37.777: [    racg][1] [18219068][1][ora.s9lp1.vip]: wed nov  6 04:17:35 cst 2013 [ 6422696 ] about to execute command: /usr/sbin/ping -s 10.0.241.150  -c 1 -w 1 10.0.241.254 (ping 网关)
wed nov  6 04:17:37 cst 2013 [ 6422696 ] isifalive: rx packets checked if=en5 failed(由于检查到网卡en5在2秒中内网卡流量包未方式变化,判断为en5失败)
1、故障每次发生都在凌晨04左右,时间如下:
2013-10-28 04:29:56
        2013-11-01 04:38:36
        2013-11-06 04:17:37
2、从源码上分析,发生故障期间网卡en5连续1秒的网络包未变化
可能的原因:
    ping -s 10.0.241.150  -c 1 -w 1 10.0.241.254
    oracle检测网管时,由于当时网络质量不好导致ping不能在1秒钟内返回结果。
    引起网卡en5 ping前 ping后没有 网络包发生变化。
  根据以上分析我们建议:
1、修改racgvip源码跳过网管检测
  修改前:
# check the status of the interface thro' pinging gateway
if [ -n $defaultgw ]
修改后:
# check the status of the interface thro' pinging gateway
if [ -n $defaultgw -a $fail_when_defaultgw_no_found -eq 1 ]
查阅oracle11.2.0.3版本的 racgvip代码,同样以次修改
以下为oracle11g的racgvip代码
if [ -n $defaultgw -a $fail_when_defaultgw_not_found -eq 1 ]
    then
      _ret=1
      # get rx packets numbers
      _o1=`$ifconfig $_if | $awk '{ if (/rx packets:/) { sub(packets:, , $2); print $2}}'`
      x=$check_times
      while [ $x -gt 0 ]
      do
        logx about to execute $ping -r -i $_if $defaultgw $ping_timeout
        $ping -r -i $_if $defaultgw $ping_timeout > /dev/null 2>&1
        rc=$?
        if [ $rc -eq 0 ]
        then
          _ret=0
          break
        else
          echo ping to $defaultgw via $_if failed, rc = $rc (host=$hostname)
        fi 
        x=$(($x-1))
      done
结论及解决方案
修改racgvip代码
修改完成后,,需要观察ora.s9lp1.vip.log里出现如下信息:
 isifalive: default gateway is not defined (host=$hostname)
表明修改失效
本文永久更新链接地址:
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product