Haproxy+keepalived+abstractroutingdatasource of the reading and writing separation cluster scheme
In the company to do the MySQL cluster solution, after several times of analysis and discussion, as well as performance test analysis. found that the Haproxy scheme is the most reliable. Use keepalived to solve the haproxy problem of the single point. Using spring's abstractroutingdatasource to solve the read-write separation of the business, the main host cluster to consider the primary node single point problem. Whether from the performance, deployment of the difficulty, this scenario is now more suitable for the company's current development.
Where keepalived installation tutorials refer to
http://phl.iteye.com/blog/1817550
Installation reference for Haproxy
http://phl.iteye.com/admin/blogs/1817551
Abstractroutingdatasource Code Reference attachment
One is the container that uses spring, and one that doesn't use the
Spring3.2.5-abstractroutingdatasource_pom.zip (6 KB)
Spring3.2.5-abstractroutingdatasource-jar-withoutspring.zip (7.2 KB)
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/