版本 mysql-5.1.45-linux-x86_64-icc-glibc23.tar.gz
安装过程同mysql replication 。
安装过程略 。
2 部署 heartbeat
下载安装包在:http://www.centos.org
heartbeat-2.1.3-3.el4.centos.x86_64.rpm
heartbeat-stonith-2.1.3-3.el4.centos.x86_64.rpm
heartbeat-devel-2.1.3-3.el4.centos.x86_64.rpm
libnet-1.1.2.1-2.rf.x86_64.rpm
heartbeat-pils-2.1.3-3.el4.centos.x86_64.rpm
perl-TimeDate-1.16-1.c4.noarch.rpm
rpm –ivh libnet-1.1.2.1-2.rf.x86_64.rpm
rpm –ivh heartbeat*
rpm –ivh perl-TimeDate-1.16-1.c4.noarch.rpm
heartbeat配置文件(两个节点操作完全相同,以其中一个节点为例,另一个节点略)
[root@IDC-D-1237 ~]# cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/
[root@IDC-D-1237 ~]# cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/
[root@IDC-D-1237 ~]# cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/
要求 authkeys 权限为600
chmod 600 authkeys
配置完成后各个文件的内容如下 :
[root@IDC-D-1237 ha.d]# cat authkeys |grep "^[^#]"
auth 2
2 sha1 HI!
[root@IDC-D-1237 ha.d]# cat ha.cf |grep "^[^#]"
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
warntime 5
initdead 120
udpport 694
ucast eth0 123.100.1.9 (对方ip)
ucast eth1 10.2.23.27 (对方ip)
auto_failback on
node IDC-D-1229
node IDC-D-1237
[root@IDC-D-1237 ha.d]# cat haresources |grep "^[^#]"
IDC-D-1229 10.2.23.88
[root@IDC-D-1237 ha.d]# service heartbeat start
ifconfig (可查看vip 漂出情况)
以上配置文件在2个节点要求完全相同。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90618/viewspace-662511/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/90618/viewspace-662511/