0
我的环境有2个MySQL服务器(INS1和INS2),当我测试故障转移模式下INS1和INS2司机科瑞连接已经非常连接速度很慢(它发生在Glassfish连接池。)JDBC MySQL的瞬移到故障转移节点很慢
final String connstr = "jdbc:mysql://INS1,INS2:3306/mysql";
Properties props = new Properties();
props.put("user", "xxx");
props.put("password", "xxx");
props.put("failOverReadOnly", "false");
props.put("roundRobinLoadBalance", "false");
return DriverManager.getConnection(connstr, props);
如何调整jdbc属性?
运行:当INS1运行。 INFO:连接在350毫秒
INFO:连接在16毫秒
INFO:连接在15毫秒
INFO:连接在17毫秒
INFO:连接在15毫秒
INFO:连接16毫秒BUILD SUCCESSFUL(总时间:0秒)
运行:当向下INS1。 INFO:连接1380毫秒
信息:连接1060毫秒
信息:连接1058毫秒
信息:连接1060毫秒
信息:连接1055毫秒
信息:连接1,041毫秒制造成功(总时间:6秒)
所以,你找到了解决办法? – shazin
是啊,我以后后发现。 ORZ –