使用haproxy,修改相关配置即可。详细参考WEB扩展篇的负载均衡章节。
#切换成mysql使用的端口 mode tcp #模式 TCP option mysql-check user root #mysql健康检查 root为mysql登录用户名
请参考WEB扩展篇的双机热备章节