记一次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个表同 ...
随机推荐
- 在eclipse中使用第三方库总结
一.建立user library 导入第三方jar文件,最简单的方式是:右键工程/属性/java build path/add external jars. 另一种方式是:window/prefren ...
- webpack入坑之旅(四)扬帆起航
这是一系列文章,此系列所有的练习都存在了我的github仓库中vue-webpack,在本人有了新的理解与认识之后,会对文章有不定时的更正与更新.下面是目前完成的列表: webpack入坑之旅(一)不 ...
- Keepalived+Redis高可用部署(第二版)
更新 20150625 脚本由5个减少为4个,sh脚本指令做了精简. 修改了另外3个脚本,在日志里增加了日期显示. 新增redis数据类型,持久化,主从同步简介. 新增hiredis简介. 新增c语言 ...
- C#高级特性_Attribute
Attribute: 公共语言运行时允许你添加类似关键字的描述声明,叫做attributes, 它对程序中的元素进行标注,如类型.字段.方法和属性等.Attributes和Microsoft .NET ...
- Hibernate原生SQL映射MySQL的CHAR(n)类型到String时出错
今天在用Hibernate通过原生SQL和ResultTransformer映射时,出现数据类型不匹配的错误.但是通过Entity映射,没有问题.在网上找了好多答案,终于解决了. 核心代码: Stri ...
- Linux_rsylogd日志
Linux_日志管理介绍(一)http://www.cnblogs.com/gossip/p/5972663.html Linux_rsyslogd日志服务(二)http://www.cnblogs. ...
- 树分治 点分治poj 2114
存在2点间距离==k 输出AYE 否则输出NAY #include<stdio.h> #include<string.h> #include<algorithm> ...
- 概率 高消light oj 1151
t个样例 n个楼梯或蛇; a b 刚好走到a会到b; 问走到100期望; dp[i] i到100的期望 这一点没奇怪的东西 dp[i]=1/6(dp[i+1]+dp[i+2]..+6); 有 ...
- shell实现两个数的相加
刚开始的时候写,一直写不对:看似简单的功能,但是一定要小心:函数的定义: funciton functionName {.....}在functionName和{之间一定有空格啊! 我就是没加空格,就 ...
- 安装完ActivePython后Python的Idle窗口打不开也卸载不掉的解决方法
1.想找一个好的PythonIDE开发环境所以就安装了ActivePython开发公具,结果发现软件打不开,机器上装的Python环境也不能用了,网上相关的解决方法也是寥寥无几...真悲催! 2.后来 ...