记一次mysql故障恢复
事情要从俩月前的一个坑说起,一台新的测试服务器,新项目一元夺宝用的。
配置aws上的一台云主机,系统盘8G,一块300G的云硬盘。
拿到机器后,另一运维小哥安装php,nginx,mysql等软件。 安装完后,然忘了挂载云硬盘。 随着根分区日志越来越多,mysql数据量增大。。。磁盘已满,mysql自行挂了。。。哭。。
开发找上门来,mysql插不进去了,我连上服务器,ps -ef。。 没有进程。
尝试重启。。失败。
查看错误日志。。如下:
161206 08:07:41 mysqld_safe Starting mysqld daemon with databases from /data/mysql
2016-12-06 08:07:41 4473 [Note] InnoDB: The InnoDB memory heap is disabled
2016-12-06 08:07:41 4473 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-12-06 08:07:41 4473 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-12-06 08:07:41 4473 [Note] InnoDB: Using Linux native AIO
2016-12-06 08:07:41 4473 [Note] InnoDB: Using CPU crc32 instructions
2016-12-06 08:07:41 4473 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-12-06 08:07:41 4473 [Note] InnoDB: Completed initialization of buffer pool
2016-12-06 08:07:41 4473 [Note] InnoDB: Highest supported file format is Barracuda.
2016-12-06 08:07:41 4473 [Note] InnoDB: Log scan progressed past the checkpoint lsn 416493596
2016-12-06 08:07:41 4473 [Note] InnoDB: Database was not shutdown normally!
2016-12-06 08:07:41 4473 [Note] InnoDB: Starting crash recovery.
2016-12-06 08:07:41 4473 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-12-06 08:07:41 4473 [Note] InnoDB: Restoring possible half-written data pages
2016-12-06 08:07:41 4473 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 416570218
2016-12-06 08:07:41 4473 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Last MySQL binlog file position 0 177880661, file name mysql-bin.000020
2016-12-06 08:07:42 4473 [Note] InnoDB: 128 rollback segment(s) are active.
2016-12-06 08:07:42 4473 [Note] InnoDB: Waiting for purge to start
2016-12-06 08:07:42 4473 [Note] InnoDB: 5.6.14 started; log sequence number 416570218
/usr/local/app/mysql-5.6.14/bin/mysqld: Error writing file '/data/mysql/mysql-slow.log' (Errcode: 28 - No space left on device)
2016-12-06 08:07:42 4473 [ERROR] Could not use /data/mysql/mysql-slow.log for logging (error 28). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
08:07:42 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail. key_buffer_size=33554432
read_buffer_size=33554432
max_used_connections=0
max_threads=1000
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 65582393 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
/usr/local/app/mysql-5.6.14/bin/mysqld(my_print_stacktrace+0x35)[0x8dd875]
/usr/local/app/mysql-5.6.14/bin/mysqld(handle_fatal_signal+0x40b)[0x64ddbb]
/lib64/libpthread.so.0(+0xf7e0)[0x7f926e2b77e0]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
161206 08:07:42 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
第25行亮了。No space left on device。找到问题了,df一看,根分区使用率100%。。。剩下/app目录300G使用率1%在那孤零零挂着。
解决办法:
移动原有文件到数据分区
# mv /data/mysql /app/
将
datadir = /data/mysql 改为datadir = /app/mysql
重启正常。
记一次mysql故障恢复的更多相关文章
- 记一次 mysql 启动没反应
记一次 mysql 启动没反应 ,重启linux又可以启动 vim /var/log/mysqld.log 2018-02-04 13:22:49 28507 [ERROR] InnoDB: Cann ...
- 记一次MySQL表分区操作
最近一次日常迭代中,业务线需要对一张大表进行联合查询,查询性能可想而知,测试过程中服务接口直接响应超时,导致服务不可用,最后临时对该表进行分区操作,暂时缓解性能问题.由于是第一次操作表分区,姑且记录一 ...
- 记一次mysql数据库被勒索(中)
背景在上一篇文章里面已经提过了. 现在面临的问题是nextcloud没有mysql数据库,用不起来了. 因为文件没丢,一种方法是启动新的mysql数据库,把文件重新提交一次. 为了程序员的面子,没有选 ...
- 记一次mysql数据库被勒索(下)
背景: nextcloud的mysql数据库被黑,删库勒索.参考:记一次mysql数据库被勒索(上) mysql数据库恢复成功,nextcloud还是无法连接.参考:记一次mysql数据库被勒索(中) ...
- 记一次mysql事务未提交导致锁未释放的问题
记一次mysql事务未提交导致锁未释放的问题 ## 查看未提交的事务(3秒内未操作的事务) SELECT p.ID AS conn_id, P.USER AS login_user, P.HOST A ...
- 【夯实Mysql基础】记一次mysql语句的优化过程
1. [事件起因] 今天在做项目的时候,发现提供给客户端的接口时间很慢,达到了2秒多,我第一时间,抓了接口,看了运行的sql,发现就是 2个sql慢,分别占了1秒多. 一个sql是 链接了5个表同时使 ...
- 记一次MYSQL更新优化
引言 今天(August 5, 2015 5:34 PM)在给数据库中一张表的结构做一次调整,添加了几个字段,后面对之前的数据进行刷新,刷新的内容是:对其中的一个已有字段url进行匹配,然后更新新加的 ...
- 记一次MySql入库后,文本出现乱码的问题
最近采用ADO.NET开发了一个工具,解析了一条如下的日志并入库(MySql) -- :: [INFO] roleName=♣丶伊诺,orderId=,price= 发现入库后的roleName中的♣ ...
- 【夯实Mysql基础】记一次mysql语句的优化过程!
1. [事件起因] 今天在做项目的时候,发现提供给客户端的接口时间很慢,达到了2秒多,我第一时间,抓了接口,看了运行的sql,发现就是 2个sql慢,分别占了1秒多. 一个sql是 链接了5个表同 ...
随机推荐
- Linux 配置只安装 64 位软件包
Centos.RHEL等系统,yum 安装的时候有时候会安装32的,然而我们只需要安装64位的软件! 解决方法: yum只安装 64 位的包,只需在 /etc/yum.conf 中加入 "e ...
- 【JavaEE企业应用实战学习记录】authorityFilter
package sanglp.servlet; import javax.servlet.*; import javax.servlet.annotation.WebFilter; import ja ...
- void与void之间没有隐式转换(纯属恶搞,请勿在意)
强大的vs弹出了这个提示:.有没有觉得强大的vs不应该出现该提示. 但就是出现了. 看客,您知道怎么让vs弹出这个提示吗^~^
- Learning jQuery, 4th Edition 勘误表
来源于:http://book.learningjquery.com/3145/errata/ Chapter 1 page 14 The CSS snippet is correct, but it ...
- oracle如何获取每个月的最后一天
SELECT LAST_DAY(DATE'2016-09-23') FROM DUAL;
- 使用D3绘制图表(2)--绘制曲线
上一篇是使用D3绘制画布,这一篇的内容是在画布上绘制曲线. 1.之前的html代码没有变化,但是我还是贴出来 <!DOCTYPE html> <html> <head&g ...
- jquery 获取Select option 选择的Text和Value
jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关设置 获取一组radio被选中项的值:var item = $(' ...
- 【转】一个DIV+CSS代码布局的简单导航条
原文地址:http://www.divcss5.com/shili/s731.shtml 简单的DIV CSS代码布局实现导航条 一个蓝色主题的导航条布局案例,本CSS小实例,采用DIV CSS实现. ...
- URI 中特殊字符
URL中的特殊字符 有些符号在URL中是不能直接传递的,如果要在URL中传递这些特殊符号,那么就要使用他们的编码了.编码的格式为:%加字符的ASCII码,即一个百分号%,后面跟对应字符的ASCII(1 ...
- mysql-now()读取当日日期-格式化
使用系统时间now(): MYSQL 获取当前日期及日期格式获取系统日期: NOW() 格式化日期: DATE_FORMAT(date, format) 注: date:时间字段format:日期格式 ...