Developers guide

Chapter 8
Copyright © 2008-2013 Inverse inc.
Operating System Best Practices 70
...
0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r----
ns:145068 nr:4448 dw:149516 dr:10490 al:31 bm:14 lo:0 pe:0 ua:0 ap:0 ep:1
wo:d oos:0
Mount the partition with:
# mount /dev/drbd0 /var/lib/mysql
Start MySQL
# service mysqld start
Execute the secure installation script in order to set the root password, remove the test databases and
anonymous user created by default:
# /usr/bin/mysql_secure_installation
Make sure MySQL does not start at boot time:
# chkconfig --level 2345 mysqld off
Heartbeat configuration
Create /etc/ha.d/ha.cf with the following content:
bcast eth0
bcast eth1
keepalive 2
warntime 30
deadtime 60
auto_failback off
initdead 120
node pf1.example.org
node pf2.example.org
use_logd yes
Here we assume that the redundant connections for the Heartbeat between the 2 servers are on eth0
and eth1.
Create /etc/ha.d/haresources with the following content:
pf1.example.com Ipaddr2::x.x.x.x IfUp::eth0.y IfUp::eth0.z drbddisk::mysql
Filesystem::/dev/drbd0::/var/lib/mysql::ext3 mysqld packetfence
x.x.x.x is PF admin virtual address
eth0.y is the name of the NIC configuration file (/etc/sysconfig/network-scripts/ifcfg_eth0.y)
dedicated to IP address in VLAN y (registration for example).