MaxScale2.0.1 with Java Druid Connection pooling considerations for read-write separation

Source: Internet
Author: User

Phenomenon:

The program will be irregular connection errors, the problem is the exception of the bug information as follows:

The last packet successfully received by the server was milliseconds ago. The last packet sent successfully to the server was on the milliseconds ago.

Java.sql.SQLException:No Database selected

however , the connection through the client sqlyog/navicat is normal.

----------------------------------------------------------------------

Another: maxscale1.4.3 sometimes hangs, Port 4006 is closed directly. After we used the watch command backstage run monitoring .

Watch-d/bin/bash/root/sh/restart_maxsacle.sh

#!/bin/bashnetstat-ntlp | grep Maxscale | grep 4006 >/dev/null 2>&1if [$?-eq 1];then/etc/init.d/maxscale Startfi


Workaround:5.6 The following can be configured directly on the URL :autoreconnect=true

for 5.6 above, only the jdbc link pool is set:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/89/C7/wKiom1gcJ8eRZd5cAABCHLTCyQg422.png "title=" Picture 1.png "alt=" Wkiom1gcj8erzd5caabchltcyqg422.png "/>


The first one is set to Ture, time-out automatic link, for MySQL to set the second to false, do not enable caching.

These are some basic configurations that need to be noted for development.

The purpose is: each time When the connection is returned, select ' x ' is executed to detect if the connection is valid.




This article is from the "Spring Yang Technical column" blog, please be sure to keep this source http://hcymysql.blog.51cto.com/5223301/1869414

MaxScale2.0.1 with Java Druid Connection pooling considerations for read-write separation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.