mysql 报wait millis 60000, active 0, maxActive 50, creating 0, createErrorCount 9913 错误 解决记录

news/2024/11/6 11:40:00/

1.由于在测试环境中,应用程序的微服务个数不是很多,且每个服务的连接池初始化链接数为:50,上线后一部分微服务出现大量以下的错误:

com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60000, active 0, maxActive 50, creating 0, createErrorCount 9913
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:778)
    at org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:71)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3261)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3874)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3911)
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60000, active 0, maxActive 50, creating 0, createErrorCount 9913
    at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1599)
    at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1326)
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1306)
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1296)
    at org.apache.dolphinscheduler.service.quartz.DruidConnectionProvider.getConnection(DruidConnectionProvider.java:39)
    at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:775)
    ... 4 common frames omitted
Caused by: java.sql.SQLException: Access denied for user 'xxx'@'127.0.0.1' (using password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
    at sun.reflect.GeneratedConstructorAccessor57.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)
    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644)
    at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2570)
[ERROR] 2020-12-15 05:59:22.374 com.alibaba.druid.pool.DruidDataSource:[2572] - create connection SQLException, url: jdbc:mysql://127.0.0.1:3306/xxx?characterEncoding=UTF-8&allowMultiQueries=true, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user 'xxx'@'127.0.0.1' (using password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
    at sun.reflect.GeneratedConstructorAccessor57.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)
    at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644)
    at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2570)

2.该种错误在百度搜索了大量的资料,各种方式都尝试过了,突然想起线上mysql数据库是新装上的,通过:show variables like '%max_connections%'; 查询,发现最大的链接数为151(默认)

3.项目上线后,微服务太多,每个微服务的初始连接池链接个数都是50

4.mysql默认最大链接数是151,很显然链接是肯定不够用,只能支持三个微服务

5.通过:set GLOBAL max_connections = 6000; 语句将mysql最大链接数改为6000,问题得到解决


http://www.ppmy.cn/news/601597.html

相关文章

lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s) timeout 60000超时问题

有一台服务器 java程序不定期会出现Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s) 错误&#xff0c;导致应用出现 timeout 60000 错误&#xff0c;重启应用后&#xff0c;问题修复&#x…

记录一次线上事故:GetConnectionTimeoutException: wait millis 60000, active 20, maxActive 20, creating 0

前几天同事说项目出问题了&#xff0c;请求一直报错&#xff0c;我看了下服务器日志&#xff0c;发现服务器一直报错Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60000, active 20, maxActive 20, creating 0 大致意思是druid的连接数&…

【完美解决】- 使用JavaApI 连接查询HBASE 出现 java.net.SocketTimeoutException: callTimeout=60000

1.报错 org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts36, exceptions:Tue May 28 08:16:11 CST 2019, null, java.net.SocketTimeoutException: callTimeout60000, callDuration63316: cm5 row stu01,, on table hbase:meta at regionhb…

mysql快速插入60000条数据

学习mysql 快速插入60000条数据&#xff0c;表字段&#xff08;id,name,nicheng&#xff09;主键id自增情况 昨天刚刚学习到的有一种写法: delimiter \ drop procedure if exists proc_if; CREATE PROCEDURE proc_if () BEGIN declare i int default 0; lp1 : LOOP //定义循环体…

使用springboot+easyExcel+MySQL读取并储存,60000+条数据

使用springbootmybatisPluseasyExcelMySQL读取并储存&#xff0c;60000条数据&#xff0c;15秒 闲话少说&#xff0c;直接开摆&#xff0c;记录一下最近用到的知识。 测试耗时&#xff08;ms&#xff09;读取6万条数据储存到MySQL&#xff0c;连续测试了五次&#xff0c;综合…

【数据结构OJ题】移除链表元素

移除链表元素 原题链接&#xff1a;力扣 给你一个链表的头节点 head 和一个整数 val &#xff0c;请你删除链表中所有满足 Node.val val 的节点&#xff0c;并返回新的头节点 。 方法一&#xff1a;原地删除节点 思路&#xff1a; 首先&#xff0c;定义两个指针&#xff1…

vue3.0 + elementUI 弹窗二次封装

使用组件&#xff1a; <page-dialog v-model:dialogShow"gisLock" footerCustom>{{gisLock}}</page-dialog><page-dialog v-model:dialogShow"gisLock">{{gisLock}}<template #dialog-button><el-button type"primary&quo…

对新手来说,一句 Hello World 能有多少坑?

入门教程、案例源码、学习资料、读者群 请访问&#xff1a;python666.cn 大家好&#xff0c;欢迎来到 Crossin的编程教室 &#xff01; 在编程届&#xff0c;有一个不成文的习惯&#xff1a;在教授/学习一门新语言时&#xff0c;会以输出“Hello World”作为第一个代码实例。 因…