近期大数据相关业务的MySQL上proxysql时遇到一个问题,开源BI平台metabase,通过proxysql访问mysql后无法建立连接。直接抛如下异常:
java.lang.Exception: java.sql.SQLNonTransientConnectionException: unexpected end of stream, read 0 bytes
from 7 (socket was closed by server)
at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:34)
at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:18)
proxysql的版本:
ProxySQL version 1.4.11-6-g4e44db1, codename Truls
proxysql日志中有报如下异常:
2019-07-18 10:14:16 MySQL_Session.cpp:95:kill_query_thread(): [WARNING] KILL CONNECTION 0 on 10.26.1.168:3306
2019-07-18 10:14:24 MySQL_Session.cpp:2448:handler(): [ERROR] Unexpected packet from client, disconnecting the client
2019-07-18 10:14:24 MySQL_Session.cpp:2448:handler(): [ERROR] Unexpected packet from client, disconnecting the client
异常后切换到直连mysql是正常的。
在git中有类似的问题:[#1138](https://github.com/sysown/proxysql/issues/1138)。大概的问题是:
1、使用了maridb的驱动,mariadb-connector-j 2.0.0 增加了一个参数usePipelineAuth,默认是开启的。就是在发送一个请求时,没有收到回复时,就可以发送下一个请求,这时proxysql来说就是一个异常请求会断掉连接,并报如下错“[ERROR] Unexpected packet from client”。
2、切换到mysql驱动后能正常使用,mysql-connector 是没有这方面的功能的
3、使用maridb驱动需要将usePipelineAuth设置为false
知道大概方向后,向开发确认信息,确实使用maridb的驱动,不过将usePipelineAuth参数设置为false还是不行,后面将驱动换成mysql就正常了。
文章最后更新时间:
2019年07月20日 14:28:59
For the reason that the admin of this web page is working, no uncertainty very rapidly it will be renowned, due to its quality contents. kotakqq
online casino games real money online casino games casino online real money best online casino for real money online gambling sites
slot games money slots online casinos for real money win real money online casino real money casino
Simply desire to say your article is as amazing. The clearness on your put up is just cool and i could assume you are an expert in this subject. Fine along with your permission allow me to grab your RSS feed to stay updated with drawing close post. Thanks 1,000,000 and please keep up the gratifying work. bandarqq
This is a topic which is close to my heart... Thank you! Where are your contact details though? DominoQQ
I think this is among the most significant information for me. And i am glad reading your article. But should remark on few general things, The web site style is wonderful, the articles is really great : D. Good job, cheers bandar99