设为首页 收藏本站
查看: 450|回复: 0

[经验分享] xtrabackup 排错

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-12-2 08:54:09 | 显示全部楼层 |阅读模式
由于线上环境数据库特别大,只能采取 xtrabackup备份还原

特点:
(1)
备份过程快速、可靠;
(2)
备份过程不会打断正在执行的事务;
(3)
能够基于压缩等功能节约磁盘空间和流量;
(4)
自动实现备份检验;
(5)
还原速度快;


innobackupex --defaults-file=/etc/my.cnf --user=root -password='root' --database=root -socket=/var//mysql/mysql.sock /root/bakmysql


一直显示报错信息

innobackupex: Waiting for ibbackup (pid=1004) to suspend
innobackupex: Suspend file '/root/bakmysql/2015-12-01_17-06-01/xtrabackup_suspended_2'

libgcc_s.so.1 must be installed for pthread_cancel to work
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 2703
        main::wait_for_ibbackup_file_create('/root/bakmysql/2015-12-01_17-06-01/xtrabackup_suspended_2') called at /usr/bin/innobackupex line 2723
        main::wait_for_ibbackup_suspend('/root/bakmysql/2015-12-01_17-06-01/xtrabackup_suspended_2') called at /usr/bin/innobackupex line 1976
        main::backup() called at /usr/bin/innobackupex line 1601
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2703.


原来发现库没安装
解决方法:yum install libgcc.i686  


第二个报错还原时候出现

151201 18:51:26  innobackupex: Starting the apply-log operation

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".

innobackupex:: Warning: Ignored unrecognized line 2 in options : 'xtrabackup: Error: Please set parameter 'datadir'
'
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 4511
main::get_option('innodb_data_file_path') called at /usr/bin/innobackupex line 2623
main::apply_log() called at /usr/bin/innobackupex line 1570
innobackupex: Error: no 'mysqld' group in server configuration file '/etc/my.cnf' at /usr/bin/innobackupex line 4511.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[iyunv@ bakmysql]# rpm -ivh percona-xtrabackup-2.2.12-1.el6.x86_64.rpm
warning: percona-xtrabackup-2.2.12-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing...                ########################################### [100%]
    file /usr/bin/innobackupex from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/bin/xbcrypt from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/bin/xbstream from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/bin/xtrabackup from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/share/man/man1/innobackupex.1.gz from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/share/man/man1/xbcrypt.1.gz from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/share/man/man1/xbstream.1.gz from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
    file /usr/share/man/man1/xtrabackup.1.gz from install of percona-xtrabackup-2.2.12-1.el6.x86_64 conflicts with file from package percona-xtrabackup-2.2.10-1.el6.x86_64
[iyunv@ bakmysql]# yum remove percona-xtrabackup-2.2.10-1.el6.x86_64
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package percona-xtrabackup.x86_64 0:2.2.10-1.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================
Package                           Arch                  Version                       Repository                Size
======================================================================================================================
Removing:
percona-xtrabackup                x86_64                2.2.10-1.el6                  installed                 21 M

Transaction Summary
======================================================================================================================
Remove        1 Package(s)

Installed size: 21 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : percona-xtrabackup-2.2.10-1.el6.x86_64                                                             1/1
  Verifying  : percona-xtrabackup-2.2.10-1.el6.x86_64                                                             1/1

Removed:
  percona-xtrabackup.x86_64 0:2.2.10-1.el6                                                                           

Complete!
[iyunv@ bakmysql]# rpm -ivh percona-xtrabackup-2.2.12-1.el6.x86_64.rpm
warning: percona-xtrabackup-2.2.12-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing...                ########################################### [100%]
   1:percona-xtrabackup     ########################################### [100%]
[iyunv@ bakmysql]#



[iyunv@ mysqlbak]# innobackupex --user=root --password='root' --defaults-file=/etc/my.cnf --apply-log  /root/ROOT/2015-12-01_19-23-53

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

151201 20:02:34  innobackupex: Starting the apply-log operation

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".

innobackupex:: Warning: Ignored unrecognized line 2 in options : 'xtrabackup: Error: Please set parameter 'datadir'
'
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 4511
main::get_option('innodb_data_file_path') called at /usr/bin/innobackupex line 2623
main::apply_log() called at /usr/bin/innobackupex line 1570
innobackupex: Error: no 'mysqld' group in server configuration file '/etc/my.cnf' at /usr/bin/innobackupex line 4511.



[iyunv@ data]# mv mysql mysql1
[iyunv@ data]# mkdir mysql
[iyunv@ data]# innobackupex --user=root --password='root' --defaults-file=/etc/my.cnf --copy-back  /root/ROOT/2015-12-01_19-23-53

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

151201 20:16:38  innobackupex: Starting the copy-back operation

IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackupex
           prints "completed OK!".

innobackupex: Starting to copy files in '/root/ROOT/2015-12-01_19-23-53'
innobackupex: back to original data directory '/data/mysql'
innobackupex: Copying '/root/ROOT/2015-12-01_19-23-53/xtrabackup_info' to '/data/mysql/xtrabackup_info'
'/data/mysql/wash/ws_user.frm'

innobackupex: Copying '/root/ROOT/2015-12-01_19-23-53/wash/ws_order_file.frm' to '/data/mysql/wash/ws_order_file.frm'
innobackupex: Copying '/root/ROOT/2015-12-01_19-23-53/wash/ws_beautician_time.frm' to '/data/mysql/wash/ws_beautician_time.frm'
innobackupex: Copying '/root/ROOT/2015-12-01_19-23-53/wash/db.opt' to '/data/mysql/wash/db.opt'

'/data/mysql/mysql/procs_priv.MYD'

innobackupex: Copying '/root/ROOT/2015-12-01_19-23-53/mysql/user.frm' to '/data/mysql/mysql/user.frm'
'/data/mysql/ib_logfile1'

innobackupex: Finished copying back files.

151201 20:16:38  innobackupex: completed OK!
完成


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-146109-1-1.html 上篇帖子: java通过JDBC连接mysql数据库 下篇帖子: mysql QPS 抓取和分析
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表