MySQL故障处理的一般流程

1. 服务器负载:平均负载、cpu使用率、磁盘空间、IO使用率、SWAP使用情况。

  常用的命令:uptime、top、sar -u -P ALL -C 1 1、df -h 、iostat -xd 2 2 、free -g

2. 数据库检查:数据库存活、连接数(select count(1) from information_schema.processlist)、

       慢SQL(select * from information_schema.processlist where user not in ('system user','event_scheduler') and command <> 'sleep' and time > 10 )、

       主从延迟(show slave status)

 

posted @ 2020-08-15 17:21  别看窗外的世界  阅读(174)  评论(0编辑  收藏  举报