binlog日志太多太大耗尽磁盘空间导致mysql卡死的问题解决
2016-04-20 12:54
816 查看
今天有同事反馈,数据库卡死了,普通的一个带limit 1只反馈一条记录的查询都好久查不出来。
我查了一下,当前并没有阻塞信息,所以不是锁竞争导致的。
查看错误日志,看到了端倪:
160419 17:03:33 [ERROR]/usr/local/mysql/bin/mysqld: Disk is full writing './mysql-bin.000177'(Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delayfor server to co
ntinue after freeing disk space)
我进mysql数据目录查看,发现有很多以前的二进制日志,所以打算清空2015年所有的二进制日志。当我使用purge binary logs to清空二进制日志时,结果该命令也卡死了。晕!
解决办法:
先rm删除binlog日志,再purge binary logs to '具体的binlog'删除。
注意:purge binary logs to 'mysql-bin.00003'表示清理mysql-bin.00003之前的所有binlog,但不包括mysql-bin.00003本身。
注意:如果只rm,不purge,重启mysql的话,会报错的,mysql就起不来了。所以rm删除后,需要及时执行purge命令。
18:44:25 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It isalso possible that this binary
or one of the libraries it was linkedagainst is corrupt, improperly built,
or misconfigured. This error can also becaused by malfunctioning hardware.
We will try our best to scrape up some infothat will hopefully help
diagnose the problem, but since we havealready crashed,
something is definitely wrong and this mayfail.
我查了一下,当前并没有阻塞信息,所以不是锁竞争导致的。
查看错误日志,看到了端倪:
160419 17:03:33 [ERROR]/usr/local/mysql/bin/mysqld: Disk is full writing './mysql-bin.000177'(Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delayfor server to co
ntinue after freeing disk space)
我进mysql数据目录查看,发现有很多以前的二进制日志,所以打算清空2015年所有的二进制日志。当我使用purge binary logs to清空二进制日志时,结果该命令也卡死了。晕!
解决办法:
先rm删除binlog日志,再purge binary logs to '具体的binlog'删除。
注意:purge binary logs to 'mysql-bin.00003'表示清理mysql-bin.00003之前的所有binlog,但不包括mysql-bin.00003本身。
注意:如果只rm,不purge,重启mysql的话,会报错的,mysql就起不来了。所以rm删除后,需要及时执行purge命令。
18:44:25 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It isalso possible that this binary
or one of the libraries it was linkedagainst is corrupt, improperly built,
or misconfigured. This error can also becaused by malfunctioning hardware.
We will try our best to scrape up some infothat will hopefully help
diagnose the problem, but since we havealready crashed,
something is definitely wrong and this mayfail.
相关文章推荐
- mysql+C#实战五:引入变量并从程序中赋值
- 关于ubuntu12.04.1上修改MySQL的my.cnf参数配置文件问题
- mysql外网无法访问
- MySQL 实现调用外部程序和系统命令
- MySQL 实现调用外部程序和系统命令
- Mac下Mysql重置密码
- 【Mysql sql inject】POST方法BASE64编码注入write-up
- 修改mysql编码格式,存入中文变为问号
- mysql添加列,修改列,删除列
- 修改数据库mysql字符编码为UTF8
- Hibernate使用mysql时type=InnoDB报错
- mysql各种日志对应的配置项
- mysql
- mysql笔记
- MySQL数据库插入乱码
- mysql延时复制
- mysql载入文本数据
- 插入随机数到mysql数据库
- mysql 5.7目录下没有data目录导致报“服务没有报告任何错误”问题
- SQL_STATE查询附录(MYSQL异常编码查询)