MySQL HA load Balancer

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.