MySQL5.7 服务 crash 后无法启动
事发背景
测试环境更换数据盘,直接采取在线将数据目录暴力拷贝到新盘,然后将原服务关闭,启用新盘。
服务是可以正常启动的,但是没多会开发就反应服务down了,错误日志输出
-- :: 0x7ffdadff7700 InnoDB: Assertion failure in thread in file trx0purge.cc line
InnoDB: Failing assertion: purge_sys->iter.trx_no <= purge_sys->rseg->last_trx_no
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
:: UTC - mysqld got signal ;
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.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail. key_buffer_size=
read_buffer_size=
max_used_connections=
max_threads=
thread_count=
connection_count=
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = K bytes of memory
Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7ffda8000900
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 = 7ffdadff6d98 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0xf32bd5]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x4a4)[0x77b844]
/lib64/libpthread.so.(+0xf7e0)[0x7ffe223e17e0]
/lib64/libc.so.(gsignal+0x35)[0x7ffe2108c5e5]
/lib64/libc.so.(abort+0x175)[0x7ffe2108ddc5]
/usr/local/mysql/bin/mysqld[0x10c5da5]
/usr/local/mysql/bin/mysqld(_ZN20TrxUndoRsegsIterator8set_nextEv+0x322)[0x1093822]
/usr/local/mysql/bin/mysqld[0x1095ea3]
/usr/local/mysql/bin/mysqld(_Z9trx_purgemmb+0x6ad)[0x10974bd]
/usr/local/mysql/bin/mysqld[0x1076178]
/usr/local/mysql/bin/mysqld(srv_purge_coordinator_thread+0x86f)[0x107914f]
/lib64/libpthread.so.(+0x7aa1)[0x7ffe223d9aa1]
/lib64/libc.so.(clone+0x6d)[0x7ffe21142aad] Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (): is an invalid pointer
Connection ID (thread ID):
Status: NOT_KILLED 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.
查看了提示的链接,可能的影响因素包括、
1、数据文件或索引文件有坏页
2、mysqld服务在运行期间,有其它项目操作数据文件和索引文件
这条和先前的操作有关,在mysqld服务运行期间我直接将数据文件拷贝到了另一盘,这样做很可能导致副本的数据和索引是不一致的
按照官网给出的建议对日志中的stack进行了解析
vim /data1/sql/mysqld.sym
0xf32bd5
0x77b844
0x7f751eed67e0
0x7f751db815e5
0x7f751db82dc5
0x10c5da5
0x1093822
0x1095ea3
0x10974bd
0x1076178
0x107914f
0x7f751eeceaa1
0x7f751dc37aad nm -D -n /usr/local/mysql/bin/mysqld > /data1/sql/mysqld.sym resolve_stack_dump -s /data1/sql/mysqld.sym -n /data1/sql/mysqld.stack
0xf32bd5 my_print_stacktrace +
0x77b844 handle_fatal_signal +
0x7f751eed67e0 _end +
0x7f751db815e5 _end +
0x7f751db82dc5 _end +
0x10c5da5 _Z23ut_dbg_assertion_failedPKcS0_m +
0x1093822 _ZN20TrxUndoRsegsIterator8set_nextEv +
0x1095ea3 _Z14trx_purge_stopv +
0x10974bd _Z9trx_purgemmb +
0x1076178 _Z26srv_get_active_thread_typev +
0x107914f srv_purge_coordinator_thread +
0x7f751eeceaa1 _end +
0x7f751dc37aad _end +
找不出导致crash的根本原因,暂时的解决方案是通过设置innodb_force_recovery来启动
相关内容参考InnoDB Recovery
1、设置innodb_force_recovery 先后设置1和2都无效,最后设置为3后启动成功
2、启动后dump所有的数据库,恢复到新建实例中
MySQL5.7 服务 crash 后无法启动的更多相关文章
- win10系统Mysql5.7服务启动报:"1053错误:服务没有及时响应启动或控制请求"
win10安装Mysql5.7: MySQL压缩包解压后,在目录下增加my.ini配置文件 [mysqld] port = basedir=D:\Mysql datadir=D:\Mysql\data ...
- 【Solr】新建core后,启动服务访问web报错 HTTP Status 503
新建core collection2后,启动solr服务,访问solr web界面报错. HTTP Status 503 - Server is shutting down or failed to ...
- 免安装的tomcat双击startup.bat后,启动窗口一闪而过,而且tomcat服务未启动。
免安装的tomcat双击startup.bat后,启动窗口一闪而过,而且tomcat服务未启动. 原因是:在启动tomcat是,需要读取环境变量和配置信息,缺少了这些信息,就不能登记环境变量,导致了t ...
- C#编写的windows服务安装后启动提示“服务启动后又停止了”
使用C#编写的windows服务安装到服务器上行后进行启动时,总是提示“服务启动后又停止了”. 检查了服务逻辑是没问题,安装在开发本地也是正常,网上查了资料说是可能是服务没有注册,我检查了服务是正常注 ...
- 一键解决更改计算机名后无法启动MSSQLSERVER服务问题
问题版本:SQL Server 2012. 解决办法:打开服务,Win + R运行services.msc,找到 SQL SERVER(MSSQLSERVER)服务右键->属性,切换至登录选项卡 ...
- mysql-5.7.18解压版启动mysql服务
1.下载mysql社区版 2.解压到D:\Program Files 3.在D:\Program Files\mysql-5.7.18-winx64\bin下,新建文件my.ini,内容如下: [cl ...
- 转:zip版Tomcat(6,7)不能注册成windows服务或者注册后不能启动的问题解决
源地址:http://www.iflym.com/index.php/code/zip-tomcat67-can-not-register-windows-services-resolve.html ...
- 自己写的服务出现"服务没有及时响应启动或控制请求 1053" 错误
自己写了一个服务,安装到电脑上后 启动时发现报"服务没有及时响应启动或控制请求 1053" 这个错误 在网上找了一些方法,都没有解决 后来,看了下,原来有个写文件的方法读取文件没有 ...
- 监控windows服务,当服务停止后自动重启服务
近期花时间研究了一下windows和linux下某服务停了后自动重启的功能,在网上收集了些资料,并经过测试,在此整理一下.这里介绍的是windows服务的监控,是通过批处理来实现的.本例是监控wind ...
随机推荐
- Random-数组
1.能够使用Random生成随机数 1)import java.util.Random; 2)Random r = new Random(); 3)r.nextIn ...
- [论文笔记] A Practical Architecture of Cloudification of Legacy Applications (2011, SERVICES)
Dunhui Yu, Jian Wang, Bo Hu, Jianxiao Liu, Xiuwei Zhang, Keqing He, and Liang-Jie Zhang. 2011. A Pra ...
- poj 2411 Mondriaan's Dream (轮廓线DP)
题意:有一个n*m的棋盘,要求用1*2的骨牌来覆盖满它,有多少种方案?(n<12,m<12) 思路: 由于n和m都比较小,可以用轮廓线,就是维护最后边所需要的几个状态,然后进行DP.这里需 ...
- 洛谷 P2253 好一个一中腰鼓!
题目背景 话说我大一中的运动会就要来了,据本班同学剧透(其实早就知道了),我萌萌的初二年将要表演腰鼓[喷],这个无厘头的题目便由此而来. Ivan乱入:“忽一人大呼:‘好一个安塞腰鼓!’满座寂然,无敢 ...
- codevs 3096 流输入练习——寻找Sb.VI
时间限制: 1 s 空间限制: 16000 KB 题目等级 : 白银 Silver 题目描述 Description 已知某开放授权人员名叫Serb,由于经常修改各种数据,因此开发人员们都喊他SB ...
- JavaScript(appendChild添加节点)
首先,我们有一个编辑器,有一个简单的HTML页面,页面的级别分别 --> html -->head[title,meta,script,link] -- body,然后再新建一个inde ...
- 【转】SpringBoot 2.0.0新版和SpringBoot1.5.2版本中Tomcat配置的差别
https://blog.csdn.net/wd2014610/article/details/79587161 2018年春SpringBoot 2.0.0 新版本有了很多新的改变,其中Tomcat ...
- 使用prelu
一个使用方式:http://blog.csdn.net/xg123321123/article/details/52610919 还有一种是像relu那样写,我就是采用的这种方式,直接把名字从relu ...
- 【page-monitor 前端自动化 上篇】初步调研
转载文章:来源(靠谱崔小拽) 前端自动化测试主要在于:变化快,不稳定,兼容性复杂:故而,想通过较低的成本维护较为通用的自动化case比较困难.本文旨在通过page-monitor获取和分析dom结构, ...
- jQuery中Ajax事件beforesend及各参数含义
Ajax会触发很多事件. 有两种事件,一种是局部事件,一种是全局事件: 局部事件:通过$.ajax来调用并且分配. $.ajax({ beforeSend: function(){ // Handle ...