`
xitonga
  • 浏览: 583278 次
文章分类
社区版块
存档分类
最新评论

[MySQL]记录一次线上故障处理过程--> has more than 'max_user_connections' active connections

 
阅读更多

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

### Error querying database. Cause: org.springframework.transaction.CannotCreateTransactionException:Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User NUXUSERalready has more than 'max_user_connections' active connections

......

### Cause: org.springframework.transaction.CannotCreateTransactionException:Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User NUXUSER already has more than 'max_user_connections' active connections

......


以上这是email报警信息,还有应用页面报500,503,504错误信息。



1 半夜接到call之后,马上登陆db,检查128组db节点组的状况,发现有db00701和db10201的connections超过了2000次。


2 想到这2台好像是上周刚维护过ssd的db server,直接ssh进取查看 sshdb00701


3 进入db00701之后,ps -eaf|grep mysql,运行正常,查看错误日志信息,发现写入binlog频繁报错。


4 进入binlog 目录/data/binlog/,发现目录下面有100多个binlog,足够有5天以上的binlog,奇怪怎么会有这么多,不是有crontab任务每天移走2天前的binlog吗?马上crontab -l发现移走binlog的任务没有开启,突然一想到,不会binlog目录磁盘满了吧?


5 执行df -h,看到/data/binlog/确实 used 为100%了,赶紧手动移走binlog,之后3分钟过后,应用正常了,页面不报5XX的错误了,db00701和db10201的connections也正常了。


总结问题原因有二:

1 此次数据库 db server切换,山姆大叔的sa组在加监控的时候,粗心大意没有把binlog的监控给加上,所以没有及时报警通知磁盘满了。

2 我们db组也没有及时double confirmed这个monitor的事情。


看来以后还得更加仔细才行。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics