利用Xtrabackup备份集合恢复一台从库的过程
1 time tar -xvf Open..tarx.gz
real 35m22.502s
user 10m16.499s
sys 1m28.578s
You have new mail in /var/spool/mail/root
PS: Open..tarx.gzv 大小80G
2 time innobackupex --user=xxx --password=xxxx --defaults-file=/etc/my.cnf --apply-log /home/alldb/
real 1m14.259s
user 0m0.356s
sys 0m2.672s
You have new mail in /var/spool/mail/root
3 copy以及chown
PS:磁盘空间不足,所以不能执行copyback,直接MV了。
mv /home/alldb/* /data/xxxx/open/
chown -R mysql.mysql /data/xxxx/open/
4 启动 service mysqld start
用5.5.20的mysql启动报错如下:
121221 10:40:36 mysqld_safe Starting mysqld daemon with databases from /data/md/open
121221 10:40:36 [Note] Flashcache bypass: disabled
121221 10:40:36 [Note] Flashcache setup error is : ioctl failed
121221 10:40:36 InnoDB: The InnoDB memory heap is disabled
121221 10:40:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121221 10:40:36 InnoDB: Compressed tables use zlib 1.2.3
121221 10:40:36 InnoDB: Initializing buffer pool, size = 4.9G
121221 10:40:37 InnoDB: Completed initialization of buffer pool
121221 10:40:37 InnoDB: Error: data file /data/md/open/ibdata2 uses page size 1024,
121221 10:40:37 InnoDB: but the only supported page size in this release is=16384
121221 10:40:37 InnoDB: Could not open or create data files.
121221 10:40:37 InnoDB: If you tried to add new data files, and it failed here,
121221 10:40:37 InnoDB: you should now edit innodb_data_file_path in my.cnf back
121221 10:40:37 InnoDB: to what it was, and remove the new ibdata files InnoDB created
121221 10:40:37 InnoDB: in this failed attempt. InnoDB only wrote those files full of
121221 10:40:37 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
121221 10:40:37 InnoDB: remove old data files which contain your precious data!
121221 10:40:37 [ERROR] Plugin 'InnoDB' init function returned error.
121221 10:40:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121221 10:40:37 [ERROR] Unknown/unsupported storage engine: InnoDB
121221 10:40:37 [ERROR] Aborting
121221 10:40:37 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
121221 10:40:37 mysqld_safe mysqld from pid file /data/md/open/test-db-20058.pid ended
5 google很久,看到说mysql升级到5.5的时候也报but the only supported page size in this release is=16384的错误,
于是就找原来版本5.1的安装目录,用mysqld_safe启动,ok,搞定
sudo /usr/local/mysql-5.1.56/bin/mysqld_safe --basedir=/usr/local/mysql-5.1.56/ --datadir=/data/md/open --user=mysql &
6 mysql 登录正常,验证slave:
mysql> grant all on *.* to 'tim'@'%' identified by 'xxxxx';
mysql> change master to master_user='repl', master_password='xxx#@!xxxx', master_host='90.60.201.30', master_log_file='mysql-bin.000449',master_log_pos=831708136;
mysql> start slave;
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 90.60.201.30
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000449
Read_Master_Log_Pos: 831708239
Relay_Log_File: mb-bbs-db3-relay-bin.003261
Relay_Log_Pos: 3914557
Relay_Master_Log_File: mysql-bin.000449
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 831708239
Relay_Log_Space: 3940542
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
ERROR:
No query specified
利用Xtrabackup备份集合恢复一台从库的过程的更多相关文章
- 利用xtrabackup备份mysql数据库
利用xtrabackup备份mysql数据库 一.安装1.直接下载二进制文件wget http://www.percona.com/downloads/XtraBackup/XtraBackup-2. ...
- MySql在生产环境中是用mysqldump还是xtrabackup备份和恢复数据
如题,究竟该使用mysqldump还是xtrabackup,要说用,两个都能备份,都支持热备,但是生产环境我们要考虑的是效率,就是不管备份还是恢复,都要快,要稳定. 之前我在维护mysql数据库的时候 ...
- xtrabackup备份和恢复数据脚本
该脚本用于备份和恢复MySQL数据库. 总结xtrabackup备份的两个坑: 1.在恢复数据的过程中,如果中途出错,则数据将会被破坏,后续很难再恢复. 2.在恢复过程中,如果版本过低,在准备全量数据 ...
- [MySQL-MM] 生产环境自动恢复MM中一台M2库的过程,分享从零开始写的自动化重建脚本以及思路 (转)
必须是MM架构,而且一台主库M1是完好无损的,一台主库M2可以根据M1主库来进行重建:如果MS架构,自己可以稍微做一下脚本修改动作,也能使用,架构如下图所示: 3 总体思路,建立主脚本a_build ...
- xtrabackup 备份和恢复
该文章接上一篇文章: 内核方面: $ cat /etc/centos-release CentOS Linux release 7.4.1708 (Core) $ uname -r 3.10.0-69 ...
- Percona Xtrabackup备份及恢复
1. http://www.percona.com/software/percona-xtrabackup下载并安装 2. 全量备份 a.全量备份到制定目录 innobacku ...
- 11g RAC OCR,VOTING DISK存储全部损坏,利用自动备份,恢复OCR,VOTING DISK到新存储。
背景: 11g R2 rac 的orc ,voting disk asm存储磁盘全部损坏.通过调查得知 损坏的 OCR磁盘对应为 VOL1 ,voting disk磁盘对应于 VOL2 . 故,添加a ...
- ORACLE 11g 用Duplicate恢复Data Guard 备库详细过程
1.先查找备库控制文件路径 先在备库上找出控制文件的路径,通过和主库一样,不过为了以防万一,还是check为好. SQL> select name from v$controlfile; NA ...
- 从xtrabackup备份恢复单表
目前对MySQL比较流行的备份方式有两种,一种上是使用自带的mysqldump,另一种是xtrabackup,对于数据时大的环境,普遍使用了xtrabackup+binlog进行全量或者增量备份,那么 ...
随机推荐
- jQuery如何设置自增自减值
一直不是很记得jquery中怎么设置自增值,比如当点击按钮时 div在当前宽度基础上增加宽度100px,可以这样写: $('button.test').click(function(){ $('div ...
- 编译原理Tiny语言的定义
Here is the definition for Tiny language The Tiny lexicon is as follows: Keywords: IF ELSE WRITE R ...
- Windows Azure 网站开发Stacks支持
编辑人员注释:本文章由 Windows Azure 网站团队的项目经理 Daria Grigoriu 和 Windows Azure 网站开发人员体验合作伙伴共同撰写. Windows Azure 网 ...
- Python中__init__方法介绍
本文介绍Python中__init__方法的意义. __init__方法在类的一个对象被建立时,马上运行.这个方法可以用来对你的对象做一些你希望的 初始化 .注意,这个名称的开始和结尾 ...
- 分享非常有用的Java程序 (关键代码)(五)---把 Array 转换成 Map
原文:分享非常有用的Java程序 (关键代码)(五)---把 Array 转换成 Map import java.util.Map; import org.apache.commons.lang.Ar ...
- zookeeper 之znode 节点
<pre name="code" class="html">使用 ls 命令来查看当前 ZooKeeper 中所包含的内容: [zk: 10.77. ...
- 如何使用不同dll的相同namespace下的相同接口
问题: 程序里加载了2个dll,这2个dll里都声明了同样的命名空间(这个不违法),然后在这个同样的命名空间下,他俩又定义了同名的interface. 然后我程序里直接using这个命名空间,使用这个 ...
- 使用ffmpeg视频编码过程中踩的一个坑
今天说说使用ffmpeg在写视频编码程序中踩的一个坑,这个坑让我花了好多时间,回头想想,非常多时候一旦思维定势真的挺难突破的.以下是不对的编码结果: ...
- android随记
[Android]中国大部分城市地区的结构定义与按拼音排序 http://blog.csdn.net/sodino/article/details/6739522
- C# - InnerList
运行效果: 代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; name ...