• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

[MySQL]记要一次线上故障处理过程-> has more than &

mysql 搞代码 4年前 (2022-01-09) 12次浏览 已收录 0个评论

[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: or

[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 NUXUSER already 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超过了2本文来源gaodai#ma#com搞@@代~&码*网/000次。

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

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的事情。

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


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:[MySQL]记要一次线上故障处理过程-> has more than &

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址