简体   繁体   English

MySQL JDBC 连接上的故障转移?

[英]Failover on MySQL JDBC connections?

I am trying to determine how i could implement a high availablity solution using the MySQL JDBC driver, it seems that there is a failover property that I can set.我正在尝试确定如何使用 MySQL JDBC 驱动程序实现高可用性解决方案,似乎有一个我可以设置的故障转移属性。 But I am wondering what people tend to use when implement a simple failover mechanism using MySQL and JDBC?但我想知道人们在使用 MySQL 和 JDBC 实现简单的故障转移机制时倾向于使用什么?

We are planning to have 2 front Tomcat servers connected to 2 MySQL servers.我们计划将 2 个前端 Tomcat 服务器连接到 2 个 MySQL 服务器。

Even though you're asking about JDBC, I hope this helps you understand all available options...即使您询问的是 JDBC,我希望这可以帮助您了解所有可用选项...

I typically handle failover by using a load balanced configuration that can gracefully failover, rather than at the JDBC layer.我通常使用可以优雅地进行故障转移的负载平衡配置来处理故障转移,而不是在 JDBC 层。

MySQL Proxy is one way to accomplish that: MySQL 代理是实现这一目标的一种方法:

http://www.cyberciti.biz/tips/mysql-proxy-howto.html http://www.cyberciti.biz/tips/mysql-proxy-howto.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM