DRBD - MySql - HearBeat - Load Balancing 6 nodes completed

Hôm nay là 2 nodes cuối của mô hình. 2 node này sẽ là MySql + DRBD. Ở entry trước ta đã instal DRBD successfully. Hôm nay sẽ là MySql.
Install MySql trên 2 node, ở đây là d1.hbn.local (192.168.1.51) và db2.hbn.local (192.168.1.52)

yum install -y mysql*

Start như bình thường, tiến hành cấu hình như mọi khi ( root pass). Sau đó stop mysql.

Cài Heartbeat như ở entry trước. Cấu hình các file như sau:
File keys như cũ:

[/etc/ha.d/authkeys]
auth 2
2 sha1 Ultramonkey!

Như entry trước

[/etc/ha.d/ha.cf]
logfacility local0
mcast eth0 225.0.0.1 694 1 0
auto_failback off
node db1.hbn.local
node db2 .hbn.local
ping 192.168.1.255
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster

Chú ý master và virtualIP

[/etc/ha.d/haresources]
db1.hbn.local LVSSyncDaemonSwap::master IPaddr2::192.168.1.50/24/eth0 drbddisk::mysql Filesystem::/dev/drbd0::/var/lib/mysql::ext3 mysqld

Disk:

[/etc/ha.d/resource.d/drbddisk]

DEFAULTFILE="/etc/drbd.conf"

chmod 600 /etc/ha.d/authkeys
cp /etc/rc.d/init.d/mysqld /etc/ha.d/resource.d/
Copy all file to db2.hbn.local
Restart drbd, heartbeat, mysql.
Test: mysql -h 192.168.1.50

------------------------------------------------------------
Thanks for reading
--------------------------------------------------------------------------
All my Lab:
Linux Lab -- window and Cisco Lab
to be continued - I will update more.

Nam Habach