In
MySQL Enterprise Backup 3.6, new option was introduced to support backup to tapes via
SBT interface. SBT stands for System Backup to Tape, an Oracle
API that helps to perform backup and restore jobs via media
management software such as Oracle's Secure Backup (OSB). There are
other storage managers like IBM's Tivoli Storage Manager (TSM) and
Symantec's Netbackup (NB) which are also supported by MEB but we
don't guarantee that it will function as expected for every release.
MEB supports SBT API version 2.0
In
this blog, I am primarily going to focus the interface of MEB and
Symantec's NB. If we are using tapes for backup, ensure that tape
library and tape drives are compatible.
Test Setup
1. Install NB 7.5 master and media servers in Linux OS. ( NB 7.1 can also be used but for testing purpose I used NB 7.5)2. Install MEB 3.8 also in Linux OS.3. Install NB admin console in your windows desktop and configure the NB master server from there.
Note:
Ensure that you have root user permission to install NetBackup.
Configuration Steps for MEB and NB
Once MEB and NB are installed,
Ensure that NB is linked to MEB by specifying the library /usr/openv/netbackup/bin/libobk.so64 in the mysqlbackup command line using --sbt-lib-path.
Configure the NB master server from windows console. That is configure the storage units by specifying the Storage unit name, Disk type, Media Server name etc.
Create NetBackup policies that are user selectable. But please make sure that policy type is "Oracle".
Define the clients where MEB will be executed. Some times this will be different host where MEB is run or some times in same Media server where NB and tapes are attached.
Now once the installation and configuration steps are performed for MEB and NB, the next part is the actual execution.MEB should be run as single file backup using --backup-image option with prefix sbt:(it is a tag which tells MEB that it should stream the backup image through the SBT interface) which is sent to NB client via SBT interface . The resulting backup image is stored where NB stores the images that it backs up. The following diagram shows how MEB interacts with MMS through SBT interface.
Backup
The following parameters should also be ready for the execution, --sbt-lib-path : Path to SBT library specific to NetBackup MMS. SBT lib for NetBackup is in /usr/openv/netbackup/bin/libobk.so64 --sbt-environment: Environment variables must be defined specific to NetBackup. In our example below, we use NB_ORA_SERV=myserver.com, NB_ORA_CLIENT=myserver.com, NB_ORA_POLICY=NBU-MEB ORACLE_HOME = /export/home2/tmp/hema/mysql-server/
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ./mysqlbackup --port=13000 --protocol=tcp --user=root --backup-image=sbt:bkpsbtNB --sbt-lib-path=/usr/openv/netbackup/bin/libobk.so64 --sbt-environment="NB_ORA_SERV=myserver.com, NB_ORA_CLIENT=myserver.com, NB_ORA_POLICY=NBU-MEB, ORACLE_HOME=/export/home2/tmp/hema/mysql-server/” --backup-dir=/export/home2/tmp/hema/MEB_bkdir/ backup-to-image
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Once backup is completed successfully, this should appear in Activity Monitor in NetBackup Console.For restore, image contents has to be extracted using image-to-backup-dir command and then apply-log and copy-back steps are applied.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
./mysqlbackup --sbt-lib-path=/usr/openv/netbackup/bin/libobk.so64 --backup-dir=/export/home2/tmp/hema/NBMEB/ --backup-image=sbt:bkpsbtNB image-to-backup-dir-----------------------------------------------------------------------------------------------------------------------------------Now apply logs as usual, shutdown the server and perform restore, restart the server and check the data contents.
./mysqlbackup ---backup-dir=/export/home2/tmp/hema/NBMEB/ apply-log
./mysqlbackup --datadir=/export/home2/tmp/hema/mysql-server/mysql-5.5-meb-repo/mysql-test/var/mysqld.1/data/ --backup-dir=/export/home2/tmp/hema/MEB_bkpdir/ innodb_log_files_in_group=2 --innodb_log_file_size=5M --user=root --port=13000 --protocol=tcp copy-back
The NB console should show 'Restore" job as done. If you don't see that there is something wrong with MEB or NetBackup.You can also refer to more detailed steps of MEB and NB integration in whitepaper here