记一次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个表同 ...
随机推荐
- 【JavaEE企业应用实战学习记录】getConnListener
Listener:当Web应用在Web容器中运行时,Web应用内部会不断地发生各种事件,如Web应用被启动.Web应用被停止,用户Session开始,用户session结束.用户请求到达等,这些对We ...
- ElasticSearch入门系列(三)文档,索引,搜索和聚合
一.文档 在实际使用中的对象往往拥有复杂的数据结构 Elasticsearch是面向文档的,这意味着他可以存储整个对象或文档,然而他不仅仅是存储,还会索引每个文档的内容使之可以被搜索,在Elastic ...
- iOS-- 重要的链接
面试题: http://www.jianshu.com/p/6a57c6e902e8 富文本: http://www.cnblogs.com/jys509/p/5018027.html
- android 按钮点击效果实现 在studio下出现的错误
在照做上一篇随笔的时候 在studio下为了方便我在写完一个 btn_select.xml 文件后直接粘贴了三个文件到drawable下 结果问题来了 总是报这样一个错误: Resource is n ...
- IntelliJ idea的使用
1.快捷键 2.插件集成 附录:参考资料
- CEPH浅析”系列之三——CEPH的设计思想
Ceph针对的目标应用场景 理解Ceph的设计思想,首先还是要了解Sage设计Ceph时所针对的目标应用场景,换言之,"做这东西的目的是啥?" 事实上,Ceph最初针对的目标应用场 ...
- Ubuntu下基于Nginx实现Tomcat集群负载均衡
版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[+] Nginx是一款HTTP和反向代理服务器,有关它的介绍可以到网上搜一下,很多很多,不再累述.这里,我们记录一下Nginx ...
- Visual Studio 2015正式版/产品密钥
Visual Studio 2015 发行说明: https://visualstudio.com/zh-cn/news/vs2015-vs.aspx Visual Studio 2015 特性简 ...
- Yii2 Redis的使用
Yii2 redis扩展 下载 将下载的解压,改名为redis,放在vendor\yiisoft\yii2\目录下 包含Connection.php,ActiveRecord.php等文件 修改 ...
- Angular实现注册系统
Angular是Google开发的前端技术框架,下载地址:https://code.angularjs.org/1.5.0/angular.js 通过对angular的简单理解后发现,angular通 ...