标签:blog http 使用 ar for strong 文件 数据 sp
使用Heartbeat实现”双机热备”或者称为“双机互备”debugfile /var/log/ha-debug #用于记录heartbeat的调试信息 logfile /var/log/ha-log #用于记录heartbeat的日志信息 logfacility local0 #系统日志级别 keepalive 2 #设定心跳(监测)间隔时间,默认单位为秒 warntime 10 ##警告时间,通常为deadtime时间的一半 deadtime 30 # 超出30秒未收到对方节点的心跳,则认为对方已经死亡 initdead 120 #网络启动时间,至少为deadtime的两倍。 hopfudge 1 #可选项:用于环状拓扑结构,在集群中总共跳跃节点的数量 udpport 694 #使用udp端口694 进行心跳监测 ucast eth1 192.168.9.6 #采用单播,进行心跳监测,IP为对方主机IP auto_failback on #on表示当拥有该资源的属主恢复之后,资源迁移到属主上 node srv5.localdomain #设置集群中的节点,节点名须与uname –n相匹配 node srv6.localdomain #节点2 ping 192.168.8.2 192.168.9.7 #ping集群以外的节点,这里是网关和另一台机器,用于检测网络的连接性 respawn root /usr/lib/heartbeat/ipfail apiauth ipfail gid=root uid=root #设置所指定的启动进程的权限
heartbeat[23230]: 2014/10/04_01:28:24 info: Local status now set to: ‘up‘ heartbeat[23230]: 2014/10/04_01:28:25 info: Link 192.168.8.2:192.168.8.2 up. heartbeat[23230]: 2014/10/04_01:28:25 info: Status update for node 192.168.8.2: status ping heartbeat[23230]: 2014/10/04_01:28:25 info: Status update for node 192.168.9.7: status ping heartbeat[23230]: 2014/10/04_01:28:25 info: Link 192.168.9.7:192.168.9.7 up. heartbeat[23230]: 2014/10/04_01:30:24 WARN: node srv6.localdomain: is dead //从节点还没有启动 heartbeat[23230]: 2014/10/04_01:30:24 info: Comm_now_up(): updating status to active heartbeat[23230]: 2014/10/04_01:30:24 info: Local status now set to: ‘active‘ //从另一台节点抢占资源 heartbeat[23230]: 2014/10/04_01:30:24 info: Starting child client "/usr/lib/heartbeat/ipfail" (0,0) heartbeat[23230]: 2014/10/04_01:30:24 WARN: No STONITH device configured. heartbeat[23230]: 2014/10/04_01:30:24 WARN: Shared disks are not protected. heartbeat[23230]: 2014/10/04_01:30:24 info: Resources being acquired from srv6.localdomain. heartbeat[23317]: 2014/10/04_01:30:24 info: Starting "/usr/lib/heartbeat/ipfail" as uid 0 gid 0 (pid 23317) harc[23318]: 2014/10/04_01:30:24 info: Running /etc/ha.d/rc.d/status status mach_down[23364]: 2014/10/04_01:30:25 info: /usr/share/heartbeat/mach_down: nice_failback: foreign resources acquired IPaddr[23385]: 2014/10/04_01:30:25 INFO: Resource is stopped //然后在本机启动资源 ResourceManager[23473]: 2014/10/04_01:30:25 info: Acquiring resource group: srv5.localdomain IPaddr::192.168.8.100/32 IPaddr[23500]: 2014/10/04_01:30:25 INFO: Resource is stopped ResourceManager[23473]: 2014/10/04_01:30:25 info: Running /etc/ha.d/resource.d/IPaddr 192.168.8.100/32 start
标签:blog http 使用 ar for strong 文件 数据 sp
原文地址:http://blog.csdn.net/kkdelta/article/details/39780611