Drbd+heartbeat + LVS + keepalived+ MySQL
Hardware: Master *: Install DRBD, Heartbeat,mysql
Slave*3: Installing MySQL
Keep Alived Host * 2: Install LVS, keepalived (real server is slave)
Application Host
IP: Two master has an ha VIP1
Two keepalived hosts have a LVS VIP2
Write operation:
Application Host (AS)->VIP1->DEV/DRBD (two master DRBD will synchronize in real time)
MySQL copy operation:
0) Start slave
1) 3 Slave an I/O thread sends a request to VIP1, requesting master to send Binlog;
2) Master will start an I/O thread to send binlog to three slave;
3) The I/O thread in 1 steps will save the changed statement to the trunk Log-relay log;
4) Slave will open an I/O read process and read the relay log.
Read operation:
Three as->vip2-> based on the LVS algorithm (RR or WRR), a Slave
That is, reading and writing are separate master and slave.
Some of the key configurations:
DRBD:/etc/drbd.conf, the local disk names of the DRBD device names, such as/dev/drbd0, Node1 and Node2, need to be configured,
The ip:7788 of Node1 and Node2
Keepalived: Configure VRRP, virtual ServerIP Configure Dr Mode, real servers add slave IP, and a script with integrated monitoring slave I/O health check.slave.pl
Lvs:ipvsadm-l can see the load status of multiple real servers, the routing algorithm RR is used for each real server performance is similar to the case, you one I, WRR weighted algorithm, the performance of the strong do more.
MySQL HA load Balancer