事发背景

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

服务是可以正常启动的,但是没多会开发就反应服务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. iOS操作系统的层次结构

    iOS操作系统4层结构,如下表 可触摸层 Cocoa Touch layer 媒体层 Media layer 核心服务层 Core Services layer 核心操作系统层 Core OS lay ...

  2. SQL注入中的整型注入实验

    首先搭建一个用于注入的环境 目录结构 conn.php 用来连接数据库的文件PHP文件 index.php 用来执行SQL命令,以及返回查询结构 index.html              一个存 ...

  3. IP-XACT IP IEEE交换格式

    1 What is  IP-XACT?      IP-XACT is an XML format that defines and describes electronic components a ...

  4. # iOS Block的本质(三)

    iOS Block的本质(三) 上一篇文章iOS Block的本质(二)中已经介绍过block变量的捕获,本文继续探寻block的本质. 1. block对对象变量的捕获,ARC 环境 block一般 ...

  5. Fixed table

    废话不多说,直接代码. <!DOCTYPE> <html> <head> <meta charset="utf-8"/> <s ...

  6. 校内选拔I题题解 构造题 Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2) ——D

    http://codeforces.com/contest/574/problem/D Bear and Blocks time limit per test 1 second memory limi ...

  7. docker安装Tensorflow并使用jupyter notebook

    目前网上提供的大多数的方法都是如下: docker pull tensorflow/tensorflow docker run -it -p : tensorflow/tensorflow 但是按照步 ...

  8. webpack 使用流程

    webpack loader 读文件的 脚手架  vue-cli: 自动化的小工具,帮咱们把项目的架子搭起来 -------------------------------------- 开发环境 n ...

  9. 数据库_8_SQL基本操作——数据操作

    SQL基本操作——数据操作 一.新增数据(两种方案) 方案1: 给全表字段插入数据,不需要指定字段列表,要求数据的值出现的顺序必须与表中设计的字段出现的顺序一致,凡是非数值数据,都需要使用引号(建议是 ...

  10. druid 配置WebStatFilter 网络统计以及监控

    WebStatFilter用于采集web-jdbc关联监控的数据. web.xml配置 <filter> <filter-name>DruidWebStatFilter< ...