HA部署中,经常会遇到ARP问题.由于路由刷新慢,服务在切换后,client端访问出错.需要等到ARP表刷新后,才能正确访问. 解决方法就是使用sendarp.前段时间为它,捆扰好长时间.所以帖个例子出来.可以放在启动服务脚本中. #!/bin/bash # # iptakeover script # # Simple script to take over an IP address. # # Usage is "iptakeover {start|stop|status}" # # sendarp is the program included with the Heartbeat program that # sends...
by NICKY.BOY - Linux文档专区 - 2006-06-07 14:48:12 阅读(1038) 回复(0)
前段时间,在这里向大家请教过一个关于HA部署时,路由ARP刷新慢的问题. http://bbs.chinaunix.net/viewthread.php?tid=757684&extra=page%3D2 我这两天,发现heartbeat有一个sendarp的脚本,好象可以解决这样的问题. 我在haresource里配置了sendarp. 如下: Admin 192.168.0.150 sendarp::192.168.0.25/eth0 myservice 192.168.0.150 是服务地址 192.168.0.25 是网卡的真实地址. 请问这样配置对么?如果是这样的话,那2台HA机器的hare...
前段时间,在这里向大家请教过一个关于HA部署时,路由ARP刷新慢的问题. http://bbs.chinaunix.net/viewthread.php?tid=757684&extra=page%3D2 我这两天,发现heartbeat有一个sendarp的脚本,好象可以解决这样的问题. 我在haresource里配置了sendarp. 如下: Admin 192.168.0.150 sendarp::192.168.0.25/eth0 myservice 192.168.0.150 是服务地址 192.168.0.25 是网卡的真实地址. 请问这样配置对么?如果是这样的话,那2台HA机器的hare...
程序内面我比较详细的做了注释,为了代码好看,注释都是用我自己憋屈的英文注释的,将就点吧!!!呵呵,我把arp的定义copy过来了,方便你们对比着阅读.... /* This program sends out one ARP packet with source/target IP and Ethernet hardware addresses suuplied by the user. It compiles and works on Linux and will probably work on any Unix that has SOCK_PACKET. kenthy@163.com */ #include netdb.h> #include...