(4.14)mysql备份还原——mysql物理热备工具之ibbackup

关键词:mysql热备工具,ibbackup,mysql物理备份工具

1. 准备

ibbackup 是 InnoDB 提供的收费工具,它支持在线热备 InnoDB 数据,主要有以下特性:

  • * Online backup of InnoDB tables — the backup takes place entirely online, without preventing queries or updates.
  • * Online backup of MyISAM tables — during the backup of InnoDB tables, read and write access is permitted to MyISAM tables. While the MyISAM tables are being copied, updates (but not reads) to the MyISAM tables are precluded.
  • * Compressed backups — the backup of InnoDB files can be compressed at various levels, saving as much as 70% or more of the storage required.
  • * Partial backups — you can selectively backup all or only some of your InnoDB tables.
  • * High performance — backup time is comparable to file copy, applying logs for recovery is even faster.
  • * Unlimited database size — no practical limit to database size or number of tables.
  • * Broad platform support — runs on Linux, Windows and leading Unix platforms.

在 innodb官网 申请了个试用版测试下,发现效果还是不错的,不过在我们自己的独特应用环境下,ibbackup 的优势并没有多少。具体的测试结果就不发上来了,有兴趣的同学自己测试看看吧。
ibbackup 只需要识别简单的几个 InnoDB 相关参数即可。它在备份时需要用到2个配置文件,一个是指定在线运行的信息,一个是备份相关信息。例如:
online-my.cnf 告诉 ibbackup 当前正在运行的mysql数据文件所在目录

[mysqld]
datadir  = /home/mysql
innodb_data_file_path = ibdata1:512M:autoextend
innodb_data_home_dir = /home/mysql
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_log_group_home_dir = /home/mysql

 

backup-my.cnf 告诉 ibbackup 备份文件存储的目录

[mysqld]
datadir  = /home/hotbackup
innodb_data_file_path = ibdata1:512M:autoextend
innodb_data_home_dir = /home/hotbackup
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_log_group_home_dir = /home/hotbackup

 

运行 ibbackup --help,就能看到以下几个主要选项:

[yejr@imysql.cn]# ibbackup --help
Usage:
ibbackup [--sleep ms] [--suspend-at-end] [--compress [level]]
[--include regexp] my.cnf backup-my.cnf
or
ibbackup --apply-log [--use-memory mb] [--uncompress] backup-my.cnf
or
ibbackup --restore [--use-memory mb] [--uncompress] backup-my.cnf

 

我一般只需要用到 --compress 以及 --uncompress,告诉 ibbackup 压缩/解压缩的级别。

开始备份

  

 备份完成

  

 

转载于:https://www.cnblogs.com/gered/p/10857998.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值