This document discusses using HAProxy to provide high availability for MySQL databases running on Amazon EC2. It describes setting up a MySQL master-master replication configuration across two EC2 instances with HAProxy load balancing between the databases. HAProxy is configured to monitor the MySQL servers and direct reads to an available master while allowing writes to both masters for redundancy.
9. HAProxy
• TCP/HTTP
• MySQL
• (Web+HAProxy+DB) x2
• Alex Williams (http://www.alexwilliams.ca/blog/
2009/08/10/using-haproxy-for-mysql-failover-and-
redundancy/)
12. Web Web
• DB2 or
HAProxy HAProxy
• HAProxy DB1
DB1 DB2
13. Web Web
• DB1 or
HAProxy HAProxy
• HAProxy DB2
DB1 DB2
14. Web Web
•
• HAProxy (DB1) HAProxy HAProxy
• read ( )
DB1 DB2