记一次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个表同 ...
随机推荐
- jq 修改input 标签的值
<input type="number" id="output" placeholder="0" /> jq使用方法 $('#o ...
- zabbix解决中文乱码问题(没有测试成功)
zabbix解决中文乱码问题 1.在windows系统中找一个自己喜欢的字体,这里我们用:msyh.ttf 2.将字体上传至/var/www/html/zabbix/fonts目录下 [root@za ...
- 不停止MySQL服务的情况下修改root的密码
首先我们得知道一个MySQL普通用户的密码 这里我来记录一下我的操作过程 这里我刚刚到一家公司上面装的是cacti,但是之前的运维不记得MySQL的root密码了 但是他知道cacti的密码, 用户: ...
- [转]fastjson常见问题
转自fastjson wiki说明文档:https://github.com/alibaba/fastjson/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98 1. ...
- [转] easyui 获取数据表格中选中行的数据 Get selected row data from...
原文地址:http://my.oschina.net/meSpace/blog/41463 http://www.easyui.net/2010/06/easyui-tutorial-get-sele ...
- ASP.Net Web Form<一> aspx文件编译及呈现
对比复习下JSP 1.jsp的本质是Servlet ,会在第一次被访问时会被翻译成一个类文件,从此对这个页面的访问都是由这个类文件执行后进行输出. aspx 本质是IHttpHandler 2.jsp ...
- js-设置焦点
function CheckForm() { if(document.form1.trainingName.value==""){ alert("培训班名称不能为空!&q ...
- MVVM: 通过 Binding 或 x:Bind 结合 Command 实现,通过 ButtonBase 触发命令
介绍背水一战 Windows 10 之 MVVM(Model-View-ViewModel) 通过 Binding 或 x:Bind 结合 Command 实现,通过 ButtonBase 触发命令 ...
- Visual Studio 2015正式版/产品密钥
Visual Studio 2015 发行说明: https://visualstudio.com/zh-cn/news/vs2015-vs.aspx Visual Studio 2015 特性简 ...
- iframe与主框架跨域相互访问方法【转】
转自:http://blog.csdn.net/fdipzone/article/details/17619673 1.同域相互访问 假设A.html 与 b.html domain都是localho ...