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 - 192.168.100.68
  • node02 - 192.168.100.69
They will share 192.168.100.65 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
192.168.100.65	server.host.com server
192.168.100.68	node01.host.com node01
192.168.100.69	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 192.168.100.65 mysqld
# vim /etc/my.cnf
bind-address = 192.168.100.65
# /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.

About

github

Creative Commons

RSS