mirror, mirror on the wall

mirror, mirror on the wall

CentOS(5.5) heartbeat mysql configuration

Posted on .

The configuration is with two nodes:
  • node01 -
  • node02 -
They will share IP address for the heartbeat service. Additional network configuration is not necessary because heartbeat service will be responsible for the configuration of the shared network address. The following commands should be executed on the both machines.

# cat /etc/hosts	server.host.com server	node01.host.com node01	node02.host.com node02
# yum install heartbeat
# cd /etc/ha.d
# vim authkeys
	auth 2
	2 sha1 test-ha
# chmod 600 authkeys
# vim ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node node01
node node02
# vim haresources
node01 mysqld
# vim /etc/my.cnf
bind-address =
# /etc/init.d/heartbeat start
# chkconfig --level 345 heartbeat on

Summary: It takes between 3 and 5 seconds on the second MySQL server to become alive if the first one becomes down.



Creative Commons