PowerHA5.5导致网关丢失的诊断过程
[size=4][font=Times New Roman][color=#000000]1,[/color][/font][font=宋体][color=#000000]问题现象[/color][/font]
[color=#000000][font=Times New Roman]AIX[/font][font=宋体]在安装了[/font][font=Times New Roman]PowerHA5.5[/font][font=宋体]之后,一旦系统重启,网关就丢失。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]2,
[/color][/font][font=宋体][color=#000000]诊断[/color][/font]
[color=#000000][font=Times New Roman]01)[/font][font=宋体]检查[/font][font=Times New Roman]inet0[/font][font=宋体]设备的属性,网关存在,排除[/font][font=Times New Roman]ODM[/font][font=宋体]库出错的可能性。[/font][/color]
[color=#000000][font=Times New Roman]02)[/font][font=宋体]通常网关是由[/font][font=Times New Roman]/etc/rc.net[/font][font=宋体]脚本在系统启动时候添加的。[/font][font=Times New Roman]init[/font][font=宋体]进程根据[/font][font=Times New Roman]/etc/inittab[/font][font=宋体]文件调用的第一个脚本是[/font][font=Times New Roman]/sbin/rc.boot 3[/font][font=宋体]。[/font][font=Times New Roman]rc.boot[/font][font=宋体]脚本在[/font][font=Times New Roman]phase 3[/font][font=宋体]调用[/font][font=Times New Roman]cfgmgr -p2[/font][font=宋体],[/font][font=Times New Roman]/etc/rc.net[/font][font=宋体]就是在此时被[/font][font=Times New Roman]cfgmgr[/font][font=宋体]调用的。是否可能没被调用?[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]3,
[/color][/font][color=#000000][font=宋体]检查[/font][font=Times New Roman]Config_Rules[/font][/color]
[i][size=9pt][font=Times New Roman]Config_Rules:[/font][/size][/i]
[/size][i][size=9pt][font=Times New Roman]
[size=4]phase = 2[/size][/font][/size][/i]
[i][size=9pt][font=Times New Roman]
[size=4]seq = 18[/size][/font][/size][/i]
[i][size=9pt][font=Times New Roman]
[size=4]boot_mask = 0[/size][/font][/size][/i]
[i][size=9pt][font=Times New Roman]
[size=4]rule = "/usr/lib/methods/cfgrcnet"[/size][/font][/size][/i]
[size=4][color=#000000][font=宋体]这个感觉和[/font][font=Times New Roman]rc.net[/font][font=宋体]有点关系,应该是在这个二进制可执行文件内部调用了[/font][font=Times New Roman]/etc/rc.net[/font][font=宋体]。通过[/font][font=Times New Roman]strings[/font][font=宋体]命令输出[/font][font=Times New Roman]/usr/lib/methods/cfgrcnet[/font][font=宋体]命令的字符串。[/font][/color]
[i][size=9pt][font=Times New Roman]/etc/rc.net -2[/font][/size][/i]
[color=#000000][font=宋体]说明[/font][font=Times New Roman]/etc/rc.net[/font][font=宋体]在系统启动时候确实被调用了。那么看看[/font][font=Times New Roman]rc.net[/font][font=宋体]的日志输出吧。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]4,
[/color][/font][color=#000000][font=宋体]检查[/font][font=Times New Roman]/tmp/rc.net.out[/font][/color]
[i][size=9pt][font=Times New Roman]0821-003 cfgif: No interfaces were configured.[/font][/size][/i]
[i][size=9pt][font=Times New Roman]<hostname>[/font][/size][/i]
[i][size=9pt][font=Times New Roman]0821-279 writing to routing socket: Cannot reach the destination network.[/font][/size][/i]
[/size][size=4][i][size=9pt][font=Times New Roman]0821-103 : The command /usr/sbin/route add -net -hopcount 0
-static 0 <gateway> failed.[/font][/size][/i]
[color=#000000][font=宋体]这个是重点。一二行是说和[/font][font=Times New Roman]hostname[/font][font=宋体]匹配的[/font][font=Times New Roman]IP[/font][font=宋体]地址不存在,三四行是说添加网关失败。其中[/font][font=Times New Roman]hostname[/font][font=宋体]就是[/font][font=Times New Roman]HACMP[/font][font=宋体]永久[/font][font=Times New Roman]IP[/font][font=宋体]地址对应的主机名,而[/font][font=Times New Roman]gateway[/font][font=宋体]就是丢似乎的网关。[/font][/color]
[font=宋体][color=#000000]几个说明:[/color][/font]
[/size][size=4][font=Times New Roman][color=#000000]a.
[/color][/font][color=#000000][font=宋体]网关应该和[/font][font=Times New Roman]service ip[/font][font=宋体]在同一网段[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]b.
[/color][color=#000000]serviced ip[/color][/font][color=#000000][font=宋体]和[/font][font=Times New Roman]base ip[/font][font=宋体]应该在不同网段[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]c.
[/color][/font][color=#000000][font=宋体]如果没有其他手段,[/font][font=Times New Roman]service ip[/font][font=宋体]不起来,那么网关也不会起来,因为没有[/font][font=Times New Roman]IP[/font][font=宋体]地址[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]d.
[/color][color=#000000]HACMP[/color][/font][color=#000000][font=宋体]的[/font][font=Times New Roman]persistent ip[/font][font=宋体]就是解决这个问题的手段之一,[/font][font=Times New Roman]persistent ip[/font][font=宋体]可以和[/font][font=Times New Roman]service ip[/font][font=宋体]在同一网段,并且可以在[/font][font=Times New Roman]/etc/hosts[/font][font=宋体]中和[/font][font=Times New Roman]hostname[/font][font=宋体]绑定[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]e.
[/color][color=#000000]persistent ip[/color][/font][color=#000000][font=宋体]在开机后自动添加,但是通过[/font][font=Times New Roman]HACMP[/font][font=宋体]的[/font][font=Times New Roman]harc.net[/font][font=宋体]脚本添加的[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]f.
[/color][color=#000000]harc.net[/color][/font][color=#000000][font=宋体]在[/font][font=Times New Roman]rc.boot[/font][font=宋体]后执行。所以在[/font][font=Times New Roman]rc.boot[/font][font=宋体]在调用[/font][font=Times New Roman]rc.net[/font][font=宋体]脚本时候系统中还没有[/font][font=Times New Roman]persistent ip[/font][font=宋体],因此出现[/font][/color][color=blue][font=Times New Roman]0821-003 cfgif: No interfaces were configured[/font][/color][color=#000000][font=宋体]报错。系统抱怨找不到和主机名匹配的[/font][font=Times New Roman]ip[/font][font=宋体]地址。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]g.
[/color][/font][color=#000000][font=宋体]因为[/font][font=Times New Roman]persistent ip[/font][font=宋体]和[/font][font=Times New Roman]service ip[/font][font=宋体]都没有起来,所以网关也无法起来。就是[/font][font=Times New Roman]route[/font][font=宋体]命令失败。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]h.
[/color][/font][color=#000000][font=宋体]原因可以确定下来是[/font][font=Times New Roman]harc.net[/font][font=宋体]调用的太晚,或者说[/font][font=Times New Roman]harc.net[/font][font=宋体]被调用后没有再次调用[/font][font=Times New Roman]/etc/rc.net[/font][font=宋体]脚本。那么为什么[/font][font=Times New Roman]HACMP5.2[/font][font=宋体]没有这个问题,而[/font][font=Times New Roman]PowerHA5.5[/font][font=宋体]有这个问题?[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]i.
[/color][/font][color=#000000][font=宋体]对比[/font][font=Times New Roman]HACMP5.2[/font][font=宋体]和[/font][font=Times New Roman]PowerHA 5.5[/font][font=宋体]的[/font][font=Times New Roman]harc.net[/font][font=宋体]脚本,有很多不同,但是和这个问题相关的应该是这个。[/font][/color]
[color=#000000][font=宋体]在[/font][font=Times New Roman]HACMP5.2[/font][font=宋体]的脚本中:[/font][/color]
[size=6][i][size=9pt][font=Times New Roman]cl_configure_persistent_address config_all -d[/font][/size][/i]
[i][size=9pt][font=Times New Roman]/etc/rc.net –boot[/font][/size][/i][/size]
[color=#000000][font=宋体]在[/font][font=Times New Roman]PowerHA5.5[/font][font=宋体]的脚本中:[/font][/color][/size][size=4]
[i][size=9pt][font=Times New Roman]clutils_log "configure all persistent IP addresses"[/font][/size][/i]
[i][size=9pt][font=Times New Roman]cl_configure_persistent_address config_all –d[/font][/size][/i]
[color=#000000][font=宋体]不管什么原因,[/font][font=Times New Roman]PowerHA5.5[/font][font=宋体]的脚本中将调用[/font][font=Times New Roman]/etc/rc.net[/font][font=宋体]的命令去掉了。这个应该就是网关丢失的关键。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]j.
[/color][/font][color=#000000][font=宋体]编辑[/font][font=Times New Roman]harc.net[/font][font=宋体],添加[/font][font=Times New Roman]/etc/rc.net[/font][/color]
[i][size=9pt][font=Times New Roman]clutils_log "configure all persistent IP addresses"[/font][/size][/i]
[i][size=9pt][font=Times New Roman]cl_configure_persistent_address config_all -d[/font][/size][/i]
[i][size=9pt][font=Times New Roman][/font][/size][/i]
[i][size=9pt][font=Times New Roman]########edit by xxx########[/font][/size][/i]
[i][size=9pt][font=Times New Roman]clutils_log "invoke /etc/rc.net -boot by xxx"[/font][/size][/i]
[i][size=9pt][font=Times New Roman]/etc/rc.net -boot[/font][/size][/i]
[/size][size=4][font=Times New Roman][color=#000000]k.
[/color][/font][font=宋体][color=#000000]重启机器[/color][/font]
[color=#000000][font=宋体]重启后网关仍然存在,检查[/font][font=Times New Roman]rc.net.out[/font][font=宋体]。虽然仍有[/font][font=Times New Roman]0821-003[/font][font=宋体]错误,但是网关添加成功。至此可以认为诊断结束。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]l.
[/color][color=#000000][/color][/font]
[/size][size=4][font=Times New Roman][color=#000000]5,
[/color][/font][font=宋体][color=#000000]后继处理[/color][/font]
[/size][size=4][font=Times New Roman][color=#000000]a.
[/color][/font][color=#000000][font=宋体]因为手工修改了[/font][font=Times New Roman]HACMP[/font][font=宋体]的脚本,所以继续观察。[/font][/color]
[/size][size=4][font=Times New Roman][color=#000000]b.
[/color][/font][color=#000000][font=宋体]等待[/font][font=Times New Roman]IBM[/font][font=宋体]的补丁。[/font][/color]
[/size][font=Times New Roman][size=4][color=#000000]6,
[/color][/size][color=#000000][/color][/font] 诊断过程中走了不少弯路,但所幸大方向是对的,所以最终还是找到了原因。发文纪念 好细致的分析
汗颜 分析的不错。 学习了...mike79好牛,在CU和那个SUN的家伙PK n轮了....;P 不错,学习一下. [quote]学习了...mike79好牛,在CU和那个SUN的家伙PK n轮了....;P
[size=2][color=#999999]diyxyj 发表于 2009-4-16 23:30[/color] [url=http://www.loveunix.net/redirect.php?goto=findpost&pid=919088&ptid=98950][img]http://www.loveunix.net/images/common/back.gif[/img][/url][/size][/quote]CU搞SUN的人很轻狂,没啥水平,和他们辩论都没意思。 在LU讨论技术,到CU灌水:lol LZ果然牛X
CU的SUN那个家伙,难道是指南非蜘蛛? 受益非浅!!! 思路很清晰,牛 其实有一个很好解决的办法,不用那么麻烦:
用alias方式把persisitent ip配置到boot1网卡上,这样网卡起来就有persistent ip,而不是依赖HACMP来起persistent ip,就算HACMP软件都被删除了,persistent ip永远是可以访问的。自然也不再需要关心rc.net与harc的先后问题 我记得以前网关是不需要和本机IP在同网段的,我以前就这样玩过主机路由。不知道为什么现在限制住了。 [b] [url=http://www.loveunix.net/redirect.php?goto=findpost&pid=919767&ptid=98950]12#[/url] [i]larryh[/i] [/b]
但是这样的话一旦boot1宕掉,persistent ip不就丢掉了?绕过HACMP设置persistent ip就不能保障persistent ip在本机网卡间的漂移了。 我说的并非HACMP中不设persistent ip了,只是先把persistent ip用系统的方法强行设置在网卡上。一旦HACMP本身正常运行,自然接管persistent ip的管理权,功能当然有效。 但是这条alias命令应该放在哪个时间点执行?理论上讲应该是在network interface被配置之后,但是在网关设置之前,那就是/etc/rc.net的defif/cfgif命令之后,defnet/cfgnet之前?难道要修改/etc/rc.net脚本?
如果放在其他地方的话,除非再次调用/etc/rc.net,否则也不会增加网关 [i=s] 本帖最后由 larryh 于 2009-4-19 17:53 编辑 [/i]
怎么老是用普通UNIX的想法搞AIX?除了普通UNIX的配置文件+命令方法,忘记了ODM了吗?
用smit配置alias,直接就在network interface的ODM中了,启动的时候,一cfgmgr,alias就存在了,而且enX肯定在inet0之前,不就自然实现了地址配置在路由配置之前吗?更不用说rc.net之类非AIX标准方法了,肯定在cfgmgr之后吧? 没尝试过基于ODM的alias,受教 正确的就应该基于ODM 难得好贴,收藏了 高手的讨论,有点朦啊 AIX+FAST+HACMP配置信息 怎么HA5.5还有这个问题?我在HA5.41上碰到过,打800电话告诉我要打IZ22483和IZ11326补丁,难道到了HA5.5还依然如旧?听说这是HACMP一个著名的问题,为什么不能彻底地解决? 经典。黄老大