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 ...
随机推荐
- 【学习笔记】六:面向对象的程序设计——理解JS中的对象属性、创建对象、JS中的继承
ES中没有类的概念,这也使其对象和其他语言中的对象有所不同,ES中定义对象为:“无序属性的集合,其属性包含基本值.对象或者函数”.现在常用的创建单个对象的方法为对象字面量形式.在常见多个对象时,使用工 ...
- 利用nodejs读取数据库数据生成树结构的json数据
在做后台管理界面的时候,几乎少不了的一个结构就是树形结构,用来做菜单导航: 那么,最希望的就是树结构的所有数据都是读取的数据库,而不是直接代码当中写死,那我们就一步一步来看: 一,建表 字段通常包括: ...
- substring()和substr()的使用以及区别
在JavaScript中,通常会用到截取,那所谓截取呢,其实就是要获得被截取元素的某个位置到某个位置的内容,那么JS给我提供了substring和substr这两种方法: 这两种截取的方式有什么区别呢 ...
- GraphicsMagick安装&make命令使用
0.0本过程为GraphicsMagick Linux版安装,通过典型的make编译安装. 未了支持png和jpg格式,首先请安装依赖.执行 yum install -y libpng-devel y ...
- imageview加载本地和网络图片
ImageView是Android程序中经常用到的组件,它将一个图片显示到屏幕上. 在UI xml定义一个ImageView如下: public void onCreate(Bundle savedI ...
- codevs 2277 爱吃皮蛋的小明(水题日常)
时间限制: 1 s 空间限制: 32000 KB 题目等级 : 白银 Silver 题目描述 Description 小明特别爱吃蛋,特别是皮蛋.他一次可以吃一个蛋或者两个蛋(整个吞下去),而且他 ...
- Gradle环境下导出Swagger为PDF
更多精彩博文,欢迎访问我的个人博客 说明 我个人是一直使用Swagger作为接口文档的说明的.但是由于在一些情况下,接口文档说明需要以文件的形式交付出去,如果再重新写一份文档难免有些麻烦.于是在网上看 ...
- IjkPlayer播放器秒开优化以及常用Option设置
https://blog.csdn.net/shareus/article/details/78585260 ijkplayer点播和直播视频 问题 解决及优化 https://blog.csdn. ...
- mysql dump 参数大全
Mysqldump参数大全 摘自:https://www.cnblogs.com/qq78292959/p/3637135.html 参数 参数说明 --all-databases , -A 导 ...
- oracle中group by的高级用法
简单的group by用法 select c1,sum(c2) from t1 where t1<>'test' group by c1 having sum(c2)>100; ro ...