记一次恢复mysql后启动报libjemalloc.so.1: cannot open shared object file错误问题
2016-10-21 20:48
696 查看
一.问题背景与描述
开发人员在生产环境mysql中不小心误更新操作,一个表的数据有两万多条记录被错误update了,由于误更新的记录数比较多,直接用sed命令去处理binlog产生undo sql再执行恢复数据的办法可能较复杂,如是与开发人员确认在一个测试环境中来恢复数据库到2016年10月21日19点40分,测试环境中已有的mysql版本为mariadb 10.0,而生产库中为mariadb 10.1.11,从生产环境tar包一份解包到测试环境,通过以下步骤来恢复数据库到特定时间点:
解压备份:
innobackupex --decompress /apps/backup/backup_3306_102001/xtrabackup/xtrabackup_20161020010001
全量恢复:
innobackupex --apply-log /apps/backup/backup_3306_102001/xtrabackup/xtrabackup_20161020010001
innobackupex --defaults-file=/apps/dbdat/my3306.cnf --copy-back /apps/backup/backup_10.16.30.101_3306_102001/xtrabackup/xtrabackup_20161020010001
然后启动mysql,无法启动,error log报如下错误:
161020 21:42:07 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended
161020 21:49:42 mysqld_safe Starting mysqld daemon with databases from /apps/dbdat/mariadb10_data3306
/apps/svr/mariadb10/bin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
161020 21:49:42 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended
161020 22:12:03 mysqld_safe Starting mysqld daemon with databases from /apps/dbdat/mariadb10_data3306
/apps/svr/mariadb10/bin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
161020 22:12:03 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended
[apps@mvxl0783 dbdat]$
二.问题分析与解决
mariadb10.0启动正常,而mariabd10.1.11启动报错:libjemalloc.so.1: cannot open shared object file,说明10.1版本开始需要更多的组件支持,缺少jemalloc包,安装如下:
yum -y install jemalloc
安装完后,再启动mysql正常。
三.后续恢复
完成全量恢复,启动mysql后,再执行增量恢复:
time /apps/svr/mariadb10/bin/mysqlbinlog mysql-bin.000015 --start-datetime='2016-10-20 01:00:38' --stop-datetime='2016-10-20 19:40:00'
|/apps/svr/mariadb10/bin/mysql -u root -psafe2016 --socket=/tmp/mysql3306.sock
恢复完成后,请开发人员检查数据,经确认,有恢复回来,后面的事情是由开发人员将测试环境中恢复的数据与生产环境作比对,并update回生产环境。
查看binlog:
/apps/svr/mariadb10/bin/mysqlbinlog -vv --base64-output=DECODE-ROWS mysql-bin.000015 --start-datetime='2016-10-20 19:00:00'|more
开发人员在生产环境mysql中不小心误更新操作,一个表的数据有两万多条记录被错误update了,由于误更新的记录数比较多,直接用sed命令去处理binlog产生undo sql再执行恢复数据的办法可能较复杂,如是与开发人员确认在一个测试环境中来恢复数据库到2016年10月21日19点40分,测试环境中已有的mysql版本为mariadb 10.0,而生产库中为mariadb 10.1.11,从生产环境tar包一份解包到测试环境,通过以下步骤来恢复数据库到特定时间点:
解压备份:
innobackupex --decompress /apps/backup/backup_3306_102001/xtrabackup/xtrabackup_20161020010001
全量恢复:
innobackupex --apply-log /apps/backup/backup_3306_102001/xtrabackup/xtrabackup_20161020010001
innobackupex --defaults-file=/apps/dbdat/my3306.cnf --copy-back /apps/backup/backup_10.16.30.101_3306_102001/xtrabackup/xtrabackup_20161020010001
然后启动mysql,无法启动,error log报如下错误:
161020 21:42:07 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended
161020 21:49:42 mysqld_safe Starting mysqld daemon with databases from /apps/dbdat/mariadb10_data3306
/apps/svr/mariadb10/bin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
161020 21:49:42 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended
161020 22:12:03 mysqld_safe Starting mysqld daemon with databases from /apps/dbdat/mariadb10_data3306
/apps/svr/mariadb10/bin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
161020 22:12:03 mysqld_safe mysqld from pid file /apps/dbdat/mariadb10_data3306/mysql.pid ended
[apps@mvxl0783 dbdat]$
二.问题分析与解决
mariadb10.0启动正常,而mariabd10.1.11启动报错:libjemalloc.so.1: cannot open shared object file,说明10.1版本开始需要更多的组件支持,缺少jemalloc包,安装如下:
yum -y install jemalloc
安装完后,再启动mysql正常。
三.后续恢复
完成全量恢复,启动mysql后,再执行增量恢复:
time /apps/svr/mariadb10/bin/mysqlbinlog mysql-bin.000015 --start-datetime='2016-10-20 01:00:38' --stop-datetime='2016-10-20 19:40:00'
|/apps/svr/mariadb10/bin/mysql -u root -psafe2016 --socket=/tmp/mysql3306.sock
恢复完成后,请开发人员检查数据,经确认,有恢复回来,后面的事情是由开发人员将测试环境中恢复的数据与生产环境作比对,并update回生产环境。
查看binlog:
/apps/svr/mariadb10/bin/mysqlbinlog -vv --base64-output=DECODE-ROWS mysql-bin.000015 --start-datetime='2016-10-20 19:00:00'|more
相关文章推荐
- 解决启动MongoDB错误:error while loading shared libraries: libstdc++.so.6:cannot open shared object file:
- linux上运行程序问题,提示cannot open shared object file错误的解决办法
- 解决命令启动Android模拟器出现lib64OpenglRender.so: cannot open shared object file问题
- [常见错误] ImportError: libpq.so.5: cannot open shared object file: No such file or directory
- Ubuntu共享库问题[gtest]_error while loading shared libraries: libgtest.so.0: cannot open shared object file: No such file or director
- 解决Linux: error while loading shared libraries: ...: cannot open shared object file: No such file or directory 类似问题
- Error loading MySQLdb module: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
- cannot open shared object file: No such file or directory 的问题解决
- 解决 libstdc++.so.5: cannot open shared object file: No such file or directory 问题
- 安装oracle 10g遇到cannot open shared object file这个错误以及解决方法
- 运行错误:error while loading shared libraries: xxx.so.0:cannot open shared object file
- 运行错误:error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or
- android 开发环境 helloworld出现问题。cannot open shared object file: No such file or directory
- (转)解决Linux:cannot open shared object file: No such file or directory 类似问题
- error while loading shared libraries: libmysqlclient.so.16/18: cannot open shared object file
- 解决 libstdc++.so.5: cannot open shared object file: No such file or directory 问题
- 共享库问题[gtest] _error while loading shared libraries: libgtest.so.0: cannot open shared object file: No such file or directory
- 报错 mysql: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
- cannot open shared object file 问题的解决
- mysql 提示libmysqlclient.so.15: cannot open shared object file