事发背景

测试环境更换数据盘,直接采取在线将数据目录暴力拷贝到新盘,然后将原服务关闭,启用新盘。

服务是可以正常启动的,但是没多会开发就反应服务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 后无法启动的更多相关文章

  1. win10系统Mysql5.7服务启动报:"1053错误:服务没有及时响应启动或控制请求"

    win10安装Mysql5.7: MySQL压缩包解压后,在目录下增加my.ini配置文件 [mysqld] port = basedir=D:\Mysql datadir=D:\Mysql\data ...

  2. 【Solr】新建core后,启动服务访问web报错 HTTP Status 503

    新建core collection2后,启动solr服务,访问solr web界面报错. HTTP Status 503 - Server is shutting down or failed to ...

  3. 免安装的tomcat双击startup.bat后,启动窗口一闪而过,而且tomcat服务未启动。

    免安装的tomcat双击startup.bat后,启动窗口一闪而过,而且tomcat服务未启动. 原因是:在启动tomcat是,需要读取环境变量和配置信息,缺少了这些信息,就不能登记环境变量,导致了t ...

  4. C#编写的windows服务安装后启动提示“服务启动后又停止了”

    使用C#编写的windows服务安装到服务器上行后进行启动时,总是提示“服务启动后又停止了”. 检查了服务逻辑是没问题,安装在开发本地也是正常,网上查了资料说是可能是服务没有注册,我检查了服务是正常注 ...

  5. 一键解决更改计算机名后无法启动MSSQLSERVER服务问题

    问题版本:SQL Server 2012. 解决办法:打开服务,Win + R运行services.msc,找到 SQL SERVER(MSSQLSERVER)服务右键->属性,切换至登录选项卡 ...

  6. mysql-5.7.18解压版启动mysql服务

    1.下载mysql社区版 2.解压到D:\Program Files 3.在D:\Program Files\mysql-5.7.18-winx64\bin下,新建文件my.ini,内容如下: [cl ...

  7. 转:zip版Tomcat(6,7)不能注册成windows服务或者注册后不能启动的问题解决

    源地址:http://www.iflym.com/index.php/code/zip-tomcat67-can-not-register-windows-services-resolve.html ...

  8. 自己写的服务出现"服务没有及时响应启动或控制请求 1053" 错误

    自己写了一个服务,安装到电脑上后 启动时发现报"服务没有及时响应启动或控制请求 1053" 这个错误 在网上找了一些方法,都没有解决 后来,看了下,原来有个写文件的方法读取文件没有 ...

  9. 监控windows服务,当服务停止后自动重启服务

    近期花时间研究了一下windows和linux下某服务停了后自动重启的功能,在网上收集了些资料,并经过测试,在此整理一下.这里介绍的是windows服务的监控,是通过批处理来实现的.本例是监控wind ...

随机推荐

  1. HDU4035 Maze(期望DP)

    题意 抄袭自https://www.cnblogs.com/Paul-Guderian/p/7624039.html 有n个房间,由n-1条隧道连通起来,形成一棵树,从结点1出发,开始走,在每个结点i ...

  2. Oracle Data Integrator 12c 安装(ODI安装)

    Oracle Data Integrator 12c 安装(ODI安装) 企业版安装步骤(包含独立安装步骤) 官网下载Oracle Data Integrator 12cR2 (12.2.1.0.0) ...

  3. Visual Studio 2005 移植 (札记之一)【zhuan】

    Visual Studio 2005 移植 - WINVER,warning C4996, error LINK1104 一.WINVER  Compile result:  WINVER not d ...

  4. uvm_pkg——老板,打包带走

    Thus spake the master programmer: “After three day without programming, life becomes meaningless.” 编 ...

  5. C++拾遗(一)——变量和基本类型

    今天看到一个小小的算法,交换两个数却不引入中间变量,想了下没什么思路.看了答案是这样: int a, b; a = a + b; b = a - b; a = a - b; 感觉还是挺有想法的,借此也 ...

  6. Mysql 主备配置

    来自:http://blog.csdn.net/u013256816/article/details/52536283 1. 了解主备配置过程原理. http://blog.csdn.net/u013 ...

  7. Scrapy-架构

    Scrapy架构(各组件的功能)及Scrapy引擎控制数据流的过程 1. Scrapy架构图(绿线是数据流向): □ Scrapy引擎(Engine):引擎负责控制数据流在系统的所有组件中流动,并在相 ...

  8. javascript 中设置window.location.href跳转无效问题解决办法

    javascript 中设置window.location.href跳转无效问题解决办法 问题情况 JS中设置window.location.href跳转无效 原因是 a标签的href跳转会执行在wi ...

  9. OracleDBConsole启动不了

    今天要用OEM,然后去打开OracleDBConsoleXXX, 提示说什么么么2,然后就各种百度...最后发现...有断了网络连接之后就可以把它启动了...简直惨,不知道这是什么原理,还有Oracl ...

  10. Js自学学习-笔记6-8

    <!-- 第6-7课笔记 --> <!-- for循环 for(条件1:判断:变化)其实就是if嵌套 while do for循环简化版 可以用do while swith case ...