nbu备份社区版mysql_mysql数据备份之NBU

本文详细介绍了Veritas NetBackup (NBU) 对MySQL数据库的备份和恢复操作,包括NBU for MySQL Agent的功能、备份流程、恢复流程,以及手工快照备份和恢复的步骤。NBU利用VSS/LVM快照实现高效、低影响的数据库备份,确保数据完整性和一致性。
摘要由CSDN通过智能技术生成

概述

Veritas NetBackup简称NBU,是一款商业化的备份和恢复软件,在金融行业占据了90%以上的市场份额,除了软件产品以外也开始推自家的备份一体机。由于具有众多的硬件、操作系统、虚拟化、数据库、应用程序和存储相关技术,现代数据中心环境复杂。这正是Netbackup长期以来成为企业可信之选,一方面可降低复杂性,同时在人手有限的情况下尽量管理数据保护。NetBackup是一款面向整个企业的单一解决方案,可通过一个混合型平台发挥其功能,而且即使是用于最大、最具动态特性的环境中也只需要进行微乎其微的管理。

通过统一的集成解决方案消除单点产品。

通过混合型备份平台实现现代化。

通过基于策略的集中管理提高工作效率。

NBUfor MySQL

NetBackup for MySQL Agent 扩展了NetBackup 的功能,以包括MySQL 数据库的备份和还原操作。代理位于NetBackup 客户端上并支持独立的设置操作。代理支持MySQL 版本5.5.5 及更高版本。NetBackup for MySQL Agent 除备份、恢复功能外,还支持:

验证备份信息。

查询备份。

从目录库文件中删除备份信息。

将还原重定向到不同于最初执行备份的客户端的另一客户端。

备份流程

136be34314a57ba454d97dfa8ef5d707.png

NetBackupfor MySQL Agent 整体备份流程为:

Agent向Mysql发出创建备份快照命令(flush tables with read lockt等)。

Mysql成功执行命令后,Agent向服务器发出VSS/LVM相关创建快照命令。

快照创建成功后,挂载快照,并把MySQL备份数据发送给NBU Server。

NBU Server把相关备份数据上传存储单元。

NBU Serve把备份状态回传给Agent。

恢复流程

136be34314a57ba454d97dfa8ef5d707.png

NetBackupfor MySQL Agent 整体恢复流程为:

Agent向NBU Server发出恢复命令。

NBU Server读取相关配置信息,把相应备份数据传给Agent。

Agent利用备份数据进行恢复。

手工快照备份、恢复

NetBackup forMySQL备份原理非常简单,就是利用VSS/LVM的快照进行的数据备份,因为创建快照非常快,因此这种方式的数据库备份也对数据库影响最小。但利用快照进行MySQL数据库备份必须保证MySQL实例、lv是一对一的关系。接下来我就利用快照这种方式进行人工备份。

备份

1.确保MySQL实例使用单一lv

136be34314a57ba454d97dfa8ef5d707.png

2.创建快照

以操作系统用户root,使用mysql客户端登陆MySQL数据库,以避免在mysql、操作系统间切换。

首先在mysql中,执行“flushtables with readlock”,使数据库把脏数据写回磁盘并处于只读状态,以保证数据备份的完整、一致性,其次记录当前的事务信息及binlog位点信息,以方便以后建立主从关系,最后创建当前mysql数据库所使用lv的快照并释放相关锁。

136be34314a57ba454d97dfa8ef5d707.png

3.备份数据

快照创建成功后,查看lv及其快照信息

136be34314a57ba454d97dfa8ef5d707.png

挂载快照

136be34314a57ba454d97dfa8ef5d707.png

利用快照,进行相关数据备份

136be34314a57ba454d97dfa8ef5d707.png

恢复

把上述备份数据传至其它主机,并在该主机创建挂载点/data,把数据还原至该挂载点即可

136be34314a57ba454d97dfa8ef5d707.png

把备份数据解压至相应目录

136be34314a57ba454d97dfa8ef5d707.png

启动数据库

总结

NetBackup for MySQL备份原理比较简单,首先发出执令“flushtable with read lock”、“showmasterstatus”至数据库,使数据库当前所有脏数据写回磁盘,并让数据库处理“静止”状态,获取数据库当前事务信息及binlog位点信息;其次必执行至操作系统,创建VSS/lvm相关快照,最后发“unlocktables”至数据库,使数据库回复正常。整个过程非常简单,耗时相对比较少,整体来说效率比较高且对数据库影响最小。最后再利用快照进行真正的数据备份。利用快照这种方式进行数据备份,必须保证MySQL实例与lv是一对一关系,并且保证lv所在vg有足够的空间,对于变更特别频繁的数据库来说,vg的剩余空间得和lv一样。

Legal Notice Copyright © 2017 Veritas Technologies LLC. All rights reserved. Veritas and the Veritas Logo are trademarks or registered trademarks of Veritas Technologies LLC or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners. This product may contain third party software for which Veritas is required to provide attribution to the third party (“Third Party Programs”). Some of the Third Party Programs are available under open source or free software licenses. The License Agreement accompanying the Software does not alter any rights or obligations you may have under those open source or free software licenses. Please see the Third Party Legal Notice Appendix to this Documentation or TPIP ReadMe File accompanying this product for more information on the Third Party Programs. The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Veritas Technologies LLC and its licensors, if any. THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. VERITAS TECHNOLOGIES LLC SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE. The Licensed Software and Documentation are deemed to be commercial computer software as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19 "Commercial Computer Software - Restricted Rights" and DFARS 227.7202, et seq. "Commercial Computer Software and Commercial Computer Software Documentation," as applicable, and any successor regulations, whether delivered by Veritas as on premises or hosted services. Any use, modification, reproduction release, performance, display or disclosure of the Licensed Software and Documentation by the U.S. Government shall be solely in accordance with the terms of this Agreement.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值