在linux下做双机热备步骤
在linux下做双机热备步骤 Red hat 9 linux的双机热备安装比较简洁,须要的安装文件有以下几个 heartbeat-1.0.4-2.rh.9.um.1.i386.rpm heartbeat-pils-1.0.4-2.rh.9.um.1.i386.rpm heartbeat-stonith-1.0.4-2.rh.9.um.1.i386.rpm net-snmp-5.0.6-17.i386.rpm 按依次依次安装 1、heartbeat-pils-1.0.4-2.rh.9.um.1.i386.rpm 2、net-snmp-5.0.6-17.i386.rpm 3、heartbeat-stonith-1.0.4-2.rh.9.um.1.i386.rpm 4、heartbeat-1.0.4-2.rh.9.um.1.i386.rpm rpm -ivh heartbeat-pils-1.0.4-2.rh.9.um.1.i386.rpm rpm -ivh net-snmp-5.0.6-17.i386.rpm rpm -ivh heartbeat-stonith-1.0.4-2.rh.9.um.1.i386.rpm rpm -ivh heartbeat-1.0.4-2.rh.9.um.1.i386.rpm 安装完成之后,起先配置主服务器。配置文件位于/etc/ha.d下,用rpm安装之后不会产生配置文件,须要从/usr/share/doc/heartbeat-1.0.4下,把ha.cf,,,,authkeys,,,,,,,,haresources,,,,三个文件cp到/etc/ha.d下面。 文件在ha.cf是主要heartbeat的配置文件,authkeys是heartbeat的平安配置文件,haresource文件是heartbeat的资源文件 其文件说明如下 ha.cf There are lots of options in this file. All you have to have is a set of nodes listed {node ...} and one of {serial, bcast, mcast, or ucast} ATTENTION As the configuration file is read line by line, THE ORDER OF DIRECTIVE MATTERS In particular, make sure that the timings and udpport et al are set before the heartbeat media are defined All will be fine if you keep them ordered as in this example. Note on logging If any of debugfile, logfile and logfacility are defined then they will be used. If debugfile and/or logfile are not defined and logfacility is defined then the respective logging and debug messages will be loged to syslog. If logfacility is not defined then debugfile and logfile will be used to log messges. If logfacility is not defined and debugfile and/or logfile are not defined then defaults will be used for debugfile and logfile as required and messages will be sent there. File to write debug messages to debugfile /var/log/ha-debug 【heartbeat的debug信息记录文件】 File to write other messages to logfile /var/log/ha-log 【日志文件】 Facility to use for syslog/logger logfacility local0 【记录日志在syslog中,可选项】 A note on specifying how long times below... The default time unit is seconds 10 means ten seconds You can also specify them in milliseconds 1500ms means 1.5 seconds keepalive how long between heartbeats keepalive 3 【每3秒发送一次keeplive消息】 deadtime how long-to-declare-host-dead deadtime 15 【假如15秒没有收到keeplive消息将会认为节点已经失效】 warntime how long before issuing late heartbeat warning See the FAQ for how to use warntime to tune deadtime. warntime 10 【在日志中记录最终心跳last heartbeat-best 前的警告时间】 Very first dead