CentOS(5.5) heartbeat mysql configuration
Posted on .
The configuration is with two nodes:
# cat /etc/hosts
# cd /etc/ha.d
# vim authkeys
# vim ha.cf
# 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.
- node01 - 192.168.100.68
- node02 - 192.168.100.69
# cat /etc/hosts
# yum install heartbeat192.168.100.65 server.host.com server 192.168.100.68 node01.host.com node01 192.168.100.69 node02.host.com node02
# cd /etc/ha.d
# vim authkeys
# chmod 600 authkeysauth 2 2 sha1 test-ha
# vim ha.cf
# vim haresourceslogfile /var/log/ha-log logfacility local0 keepalive 2 deadtime 30 initdead 120 bcast eth0 udpport 694 auto_failback on node node01 node node02
# vim /etc/my.cnfnode01 192.168.100.65 mysqld
# /etc/init.d/heartbeat startbind-address = 192.168.100.65
# 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.