配置HEARTBEAT:
有三个配置文件:
ha.cf
authkeys
haresources
设定ha.cf文件
这是关键的配置文件,同样的,可以先从示例中考贝过来:
cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d
有三个配置文件:
ha.cf
authkeys
haresources
设定ha.cf文件
这是关键的配置文件,同样的,可以先从示例中考贝过来:
cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d
vi /etc/ha.d/ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
lagfacility local0
ucast eth1 192.168.100.101
auto_failback on
node sql3
node sql4
respawn hacluster /usr/lib64/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
debugfile /var/log/ha-debug
logfile /var/log/ha-log
lagfacility local0
ucast eth1 192.168.100.101
auto_failback on
node sql3
node sql4
respawn hacluster /usr/lib64/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
vi /etc/ha.d/ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
ucast eth1 192.168.100.102
auto_failback on
node sql3
node sql4
respawn hacluster /usr/lib64/headrtbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
ucast eth1 192.168.100.102
auto_failback on
node sql3
node sql4
respawn hacluster /usr/lib64/headrtbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
设定authkeys文件
该文件是集群中各节点相节认证的配置文件,允许使用crc(明文)、md5、sha1等不同的验
该文件是集群中各节点相节认证的配置文件,允许使用crc(明文)、md5、sha1等不同的验
证方式,可以使用heartbeat自带的示例来修改:
# cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/
# cd /etc/ha.d
# chmod 600 authkeys
# cat authkeys
auth 3
#1 crc
#2 sha1 HI!
3 md5 Hello!
设定haresources文件
这个是1.x使用的集群资源文件,每行一个组,第一列定义的是优先级服务器,也就是默认
# cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/
# cd /etc/ha.d
# chmod 600 authkeys
# cat authkeys
auth 3
#1 crc
#2 sha1 HI!
3 md5 Hello!
设定haresources文件
这个是1.x使用的集群资源文件,每行一个组,第一列定义的是优先级服务器,也就是默认
资源运行在该服务器上:
cat haresources
ndb1 192.168.1.211 httpd
chmod 600 /etc/ha.d/authkeys
/sbin/chkconfig --level 2345 headrbeat on
/sbin/chkconfig --del ldirectord
启动heartbeat
/etc/init.d/ldirecord stop
/etc/init.d/heartbeat start
cat haresources
ndb1 192.168.1.211 httpd
chmod 600 /etc/ha.d/authkeys
/sbin/chkconfig --level 2345 headrbeat on
/sbin/chkconfig --del ldirectord
启动heartbeat
/etc/init.d/ldirecord stop
/etc/init.d/heartbeat start
本文转自 jxwpx 51CTO博客,原文链接:http://blog.51cto.com/jxwpx/209846,如需转载请自行联系原作者