[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 connectionsorg.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超過了2000次。
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的事情。
看來以后還得更加仔細才行。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com