NetBackup10 AdminGuide MySQL
NetBackup10 AdminGuide MySQL
Administrator's Guide
Release 10.0
NetBackup™ for MySQL Administrator's Guide
Last updated: 2022-02-25
Legal Notice
Copyright © 2022 Veritas Technologies LLC. All rights reserved.
Veritas, the Veritas Logo, and NetBackup 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. Refer to the Third-party Legal Notices document accompanying this
Veritas product or available at:
https://www.veritas.com/about/legal/license-agreements
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 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.
http://www.veritas.com
Technical Support
Technical Support maintains support centers globally. All support services will be delivered
in accordance with your support agreement and the then-current enterprise technical support
policies. For information about our support offerings and how to contact Technical Support,
visit our website:
https://www.veritas.com/support
You can manage your Veritas account information at the following URL:
https://my.veritas.com
If you have questions regarding an existing support agreement, please email the support
agreement administration team for your region as follows:
Japan CustomerCare_Japan@veritas.com
Documentation
Make sure that you have the current version of the documentation. Each document displays
the date of the last update on page 2. The latest documentation is available on the Veritas
website:
https://sort.veritas.com/documents
Documentation feedback
Your feedback is important to us. Suggest improvements or report errors or omissions to the
documentation. Include the document title, document version, chapter title, and section title
of the text on which you are reporting. Send feedback to:
NB.docs@veritas.com
You can also see documentation information or ask a question on the Veritas community site:
http://www.veritas.com/community/
https://sort.veritas.com/data/support/SORT_Data_Sheet.pdf
Contents
Index .................................................................................................................... 43
Chapter 1
Introduction to NetBackup
for MySQL Agent
This chapter includes the following topics:
Note: Ensure that versions of the MySQL agent and NetBackup are same for
successful backup and restore operations. If you upgrade NetBackup to newer
version, then you must upgrade the agent version also.
Introduction to NetBackup for MySQL Agent 7
Features of NetBackup for MySQL Agent
Features Description
Redirected restore The agent supports to restore MySQL backups to alternate NetBackup
clients.
Step Action
Step 2 Verify the prerequisites before you install the NetBackup for MySQL Agent.
Step 3 Install the NetBackup for MySQL Agent on your operating system.
For more information, See “Installing the NetBackup for MySQL Agent”
on page 12.
User Privileges
■ NBMySQLAgent_8.2_AMD64/NBMySQLAgent.msi
■ NBMySQLAgent_8.2_AMD64/Setup.exe
■ NBMySQLAgent_8.2_AMD64/CAB1.CAB
When you install the agent, you have to accept the VERITAS LICENSE
AGREEMENT, to proceed installing the agent successfully.
The agent by default gets installed at the following locations:
■ (Windows) C:\Program Files\Veritas\NBMySQLAgent
■ (Linux RHEL and SUSE) /usr/NBMySQLAgent/
Note: Ensure that the MySQL agent and NetBackup are of same version for
successful backup and restore operations.
port=3306
password= type the password
In MySQL v5.6 and later, it reads the encrypted authentication credentials from the
MySQL options .mylogin.cnf file.
To authenticate the password
1 (Windows) Run the following command:
mysql_config_editor.exe set --port=<portnumber> --password
3 To reset the password, run the command that applies to your operating system:
■ (Windows) mysql_config_editor.exe reset
Installing NetBackup for MySQL Agent 14
Uninstalling the NetBackup for MySQL Agent
4 To validate the password, run the command that applies to your operating
system:
■ (Windows) mysql_config_editor.exe print --all
■ (Linux) mysql_config_editor print --all
DB_USER Configures the MySQL database Backup and restore When you do not set the
user name. operations. database user name, it
defaults to root.
DB_PORT Configures the MySQL database Restore operations When you do not set the
server port number on which the database server port, it
backup or the restore has to be defaults to 3306.
performed.
DB_HOST Configures the MySQL database Non-LVM restore No default value for this
hostname. operations parameter. This parameter
must be specified.
NETBACKUP_MASTER_SERVER Specifies the NetBackup master Backup operations No default value for this
server to run backups and restores. parameter.
NETBACKUP_POLICY_NAME Specifies the NetBackup DataStore Backup operations No default value for this
policy name. parameter.
NETBACKUP_SCHEDULE_NAME Identifies the backup schedule that Backup operations No default value for this
you configured while creating the parameter.
DataStore policy.
NETBACKUP_CLIENT_NAME Defines the NetBackup MySQL Redirected When you do not set the
client name. restores and query NetBackup client, it
backups. defaults to the NetBackup
master server.
SNAPSHOT_SIZE (Linux) Specifies the snapshot size LVM backups When you do not set the
in kilobytes, megabytes, or snapshot size, it defaults
gigabytes as K, M, or G to MB.
respectively.
Configuring NetBackup for MySQL Agent 17
The nbmysql configuration file
COPY_ID Represents the backup image To query, restore, No default value for this
name. You can use this value to or delete a backup parameter.
query, restore, or delete a specific using its backup
backup. image name.
MYSQL_TARGET_DIRECTORY Specifies the destination directory Restore backups. No default value for this
where you want to restore the parameter.
backups.
MYSQL_INSTALL_DIRECTORY Specifies the directory where your Backup from the No default value for this
MySQL instance is installed provided directory. parameter.
NBMYSQL_LOG_LEVEL The NBMYSQL_LOG_LEVEL lets The log levels help When you do not set
you set the logging level for the to control the nbmysql log level, it
NetBackup MySQL logs. The amount of defaults to level 1.
default value is 1. For a particular information that
logging level, all details at that level you want to
or lower are logged. access, when
troubleshooting
The MySQL debug logs includes
errors.
the following verbose levels:
NBMYSQL_LOG_SIZE Configures the nbmysql.conf You can specify When you do not specify
log size in MB. When the log the value according the nbmysqllog size, the
reaches the specified size, it to the events that default is 10MB.
overwrites the log information. you want to write
into the logs.
Configuring NetBackup for MySQL Agent 18
Configuring the NetBackup for MySQL backups with DataStore policies
Note: The XBSA framework supports the Application backup schedule type
only.
8 In the Clients tab, click New, and then add the NetBackup client that has the
NetBackup for MySQL Agent.
Configuring NetBackup for MySQL Agent 19
Configuring the NetBackup for MySQL backups with DataStore policies
9 In the Add Client screen, click New, and then in the Client Name field, type
the name of the client.
10 In the NetBackup Administration Console, click NetBackup Management>
Policies to view the policy in the existing policies list.
11 Verify the parameters in nbmysql.conf before you run the backup operation
or specify them on the nbmysql command line.
For more information, See “The nbmysql configuration file” on page 15.
Note: Ensure that the MySQL agent and NetBackup are of same version for
successful backup and restore operations.
Chapter 4
NetBackup for MySQL
backup and restore
This chapter includes the following topics:
■ Redirected restores
■ Disaster recovery
MySQL
Database server Sends MySQL
data for back up
Requests snapshot, reads and NetBackup
mounts snapshot, reads the 3 NetBackup
MySQL agent
MySQL data master server
2 5
Snapshot Back up status is
creation returned
NetBackup
media server
NetBackup client
NetBackup XBSA
MySQL data
VSS/LVM Snapshot 4 is backed up
Storage unit
Prerequisites
Before you run the backup, ensure that you meet the following prerequisites.
■ Ensure that versions of the MySQL agent and NetBackup are same. If you
upgrade NetBackup to newer version, then you must upgrade the agent version
also.
■ Ensure that the user has administrator (Windows) or root (Linux) access.
NetBackup for MySQL backup and restore 22
Performing the MySQL backups
■ (LVM users) Ensure that the MySQL data and logs directory reside on a single
logical volume.
■ Configure the DataStore policy from the NetBackup Administration Console.
■ Add the database parameters and library path in the nbmysql.conf file.
■ Verify that there is enough space for the snapshot in the volume group, and
then set the snapshot size in nbmysql.conf file or by the command line.
Note: Ensure that the snapshot size is 50% more than the instance size that
you want to backup.
■ Verify that the prerequisites and the post-installation requirements are met.
For more information, See “Installing prerequisites of NetBackup for MySQL
Agent” on page 10.
For more information, See “Post-installation requirements for NetBackup for
MySQL Agent ” on page 11.
To run backup
1 Run the following command:
nbmysql -o backup
-S master_server_name
-P policy_name
-s schedule_name
-l mysql_lib_path
(Linux) -z snapshot_size
[-p database_server_port]
[-u database_username]
(Linux) [-b backup_type]
2 (Optional) Type the password, when the nbmysql command line prompts for
the password.
Note: Ensure that the MySQL agent and NetBackup are of same version for
successful backup and restore operations.
For example, to list backup files with the policy name policy_name, run the following
command:
nbmysql -o query -S master_server_name [-P policy_name]
For example, to query a backup from the client Client A with policy name
policy_name, run the following command:
Read progress
file
2
Progress file
Restore
NetBackup Initiate restore
MySQL data
NetBackup
MySQL agent 1
4 master server
MySQL
3
Database server Retrieve data
to restore
NetBackup
media server
NetBackup client
NetBackup XBSA
Storage unit
NetBackup for MySQL backup and restore 25
Performing the restores for MySQL databases
The parameter-S, t, and -p are required parameters. Alternatively, you can choose
to restore using the optional values -i as the backup image name and -C to restore
from a specified client name.
Note: The restore fails when the target directory is invalid or not empty. Ensure
that you delete all contents of the target directory before you initiate the restore
operation.
Note: Ensure that the MySQL agent and NetBackup are of same version for
successful backup and restore operations.
Prerequisites
Before you restore the backups, you must meet the following prerequisites:
■ Ensure that versions of the MySQL agent and NetBackup are same. If you
upgrade NetBackup to newer version, then you must upgrade the agent version
also.
■ Ensure that the user has administrator (Windows) or root (Linux) access.
■ Ensure that you restore the MySQL instance to an empty target directory.
■ Ensure that the target directory is a valid instance directory.
■ (Non-LVM) Ensure the MySQL services are running.
To restore the backups
1 Configure the parameters in the nbmysql.conf file, or specify them using the
nbmysql command.
For more information, See “The nbmysql configuration file” on page 15.
2 Verify that the MySQL services are running for Non-LVM restores.
3 Run the following command:
nbmysql -o restore -S master_server_name -t target_directory -p
db_port [-i copy_id] [-C client_name] [-u db_user] [-H db_host]
NetBackup for MySQL backup and restore 26
Redirected restores
Redirected restores
A redirected restores lets you restore backup files to a client different from the client
that originally performed the backup. The new location can be a different host or a
different file path using a different name for the redirected restore. To redirect a
restore to a different host, include the destination client name in the
install_path\NetBackup\db\altnames directory.
Note: Ensure that the MySQL agent and NetBackup are of same version for
successful backup and restore operations.
3 In the altnames directory, add the names of the client(s) whose files the
requesting client wants to restore. For example, if you want Host B to have
permissions to redirect restores from Host A, add Host A to the Host B file.
4 Run the following command:
nbmysql -o restore -S master_server_name -t target_directory -p
db_port [-i copy_id] [-C client_name] [-u db_user] [-H db_host]
5 After a successful redirected restore, undo the changes that you made on the
master server and the client.
To redirect a restore to a different file path
1 Run the following command:
nbmysql -o restore -S master_server_name -t target_directory -p
db_port [-i copy_id] [-C client_name]
■ (Linux) To change the ownership of the files and directories to MySQL, run
the following command:
$chown -R mysql <data_dir>
$chgrp -R mysql <data_dir>
Disaster recovery
Disaster recovery is a plan to recover the data that can get lost in a disaster event.
The NetBackup for MySQL Agent uses redirected restore as a disaster recovery
strategy.
For more information, See “ Redirected restores ” on page 26.
Chapter 5
Troubleshooting for
NetBackup for MySQL
This chapter includes the following topics:
■ install_path\NetBackup\logs\bpcd
■ install_path\NetBackup\logs\user_ops\dbext\logs
The logs that are specific to NetBackup for MySQL Agent is located at:
install_path\nbmysql.log
Preliminary steps
Verify the following, before you troubleshoot the problems:
■ All the prerequisites are completed.
■ All the computers have compatible operating system versions.
Troubleshooting for NetBackup for MySQL 29
Troubleshooting errors for the NetBackup for MySQL Agent
The nbmysql backup fails The nbmysql backup may fail for For a successful backup, complete any of the
with the following error: any of the following reasons: following:
An error has occurred during ■ The NetBackup media server ■ Upgrade the media server or client to use
backup or client runs on NetBackup 8.0 NetBackup 8.1 or later versions.
or earlier versions. ■ In NetBackup Administration Console, under
■ The check box for Enable in Security Management > Global Security
secure communication with Settings, select the Enable in secure
NetBackup8.0 and earlier communication with NetBackup 8.0 and
hosts is disabled earlier hosts check box.
■ The NetBackup host ID ■ Verify the NetBackup host ID certificate. You
certificate that exists on the can manually obtain the host ID certificate. For
MySQL client is invalid. more information, see
www.veritas.com/support/en_US/article.000127129
The nbmysql agent fails to The MySQL agent displays an error When the agent fails to initiate operations due to
initiate any operation. that is related to absence of the absence of the I18N file, copy the language file
I18N file. You may encounter this in the agent installer location and then run the
problem when you launch the operations.
agent.
The nbmysql backup fails You may encounter this problem Verify the following and then run the backup again:
with the following error: when the nbmysql.conf file is not
■ Add or update the MySQL library file location
updated with the following:
Unable to load MySQL library in the nbmysql.conf file.
■ The MySQL library file location. For more information, See “The nbmysql
■ The configuration file” on page 15.
MYSQL_LIB_INSTALL_PATH ■ Ensure that the MYSQL_LIB_INSTALL_PATH
does not point to is set to the absolute path of the symbolic link.
libmysqlclient.so.<n> ■ Create a symbolic link libmysqlclient.so
that points to the libmysqlclient.so.<n>
version.
For more information, See “Post-installation
requirements for NetBackup for MySQL Agent
” on page 11.
Troubleshooting for NetBackup for MySQL 30
Troubleshooting errors for the NetBackup for MySQL Agent
The nbysql backup fails with The nbmysql backup fails if the To add the appropriate database user name and
the following error message: nbmysql.conf includes an invalid port number
database user name and the port
Unable to connect to the ■ Configure the appropriate database user name
number.
database and port number in the nbmysql.conf file or
provide the appropriate options with the
nbmysqlcommand.
For more information, See “The nbmysql
configuration file” on page 15.
■ If the backup fails again, verify if the MySQL
services are running.
The nbmysql backup fails The nbmysql backup fails if the To run a MySQL backup successfully
with the following error: environment variable path is not
■ Update the environment variable path with
updated with NetBackup bin
Unable to load xbsa.dll NetBackup_install_path/bin.
directory.
The nbmysql backup fails The nbmysql backup fails if the To run the NetBackup backup successfully
with the following error: nbmysql.conf file is not updated
■ Configure the valid master server name, policy
with the required parameters.
XBSA initiation failed name, schedule type in the nbmysql.conf
file or from the command line.
For more information, See “The nbmysql
configuration file” on page 15.
■ Verify if there are communication errors
between the agent and the NetBackup master
server. For more information see the
NetBackup Administration guide.
Troubleshooting for NetBackup for MySQL 31
Troubleshooting errors for the NetBackup for MySQL Agent
The nbmysql backup on The nbmysql backup fails during To unmount the snapshot
Linux (LVM), fails with the an attempt to unmount the
1 List all mounted file systems using the
following error: snapshot, the device, or when you
following command:
remove the existing snapshots.
Error unmounting the
$ mount-l
snapshot-Device or resource
busy 2 If the snapshot still exists, create a mount
directory using the following command:
OR
$mount<mount_directory>
Error removing the
snapshot-mysqlsnap_<timestamp> Note: This directory is created in
/mnt/<snapshot_name>. The prefix names
Note: <timestamp> is the
for snapshot are mysqlsnap.
LVM snapshot time
3 To remove the mount directory run the
following command:
1vremove -f
<volume_group>/<snapshot_name>
Error messages after a The nbmysql backup gives these To remove the snapshots
successful backup: errors when the volume group
1 Run the following command to list the existing
contains the snapshots. You can
<volume_group>/<snapshot_name> snapshots::
list the snapshots and then remove
Read failure after 0 of 4096
them before you run the backup $lvs
at 29393616896: input or
again.
output error. The command displays the snapshot details.
The nbmysql backup fails The nbmysql backup may fail To verify the space in the volume group
with the following error: when the volume group does not
1 Run the following command to view the
have sufficient space for the
(Linux)Error creating LVM volume group details:
snapshot.
snapshot
$vgs
(Windows)VSS snapshot The nbmysql backup may fail Run cmd.exe in Administrator mode.
creation failed when the user does not have the
privileges to run the nbmysql
operations.
The nbmysql restore The nbmysql restore fails if the Add or update the NetBackup client name in the
operation does not restore nbmysql.conf file is not updated nbmysql.conf file.
any data from the target with the NetBackup client name.
For more information, See “The nbmysql
NetBackup client.
configuration file” on page 15.
The nbmysql restore is The nbmysql restore fails if the For a successful restore
unsuccessful when you target directory is invalid or not
■ Verify that the target directory is a valid and
trigger from the target client. empty for restores.
empty.
The restore may also fail, when you ■ Initiate the restore from the NetBackup source
initiate a redirected restore from the client.
NetBackup target client instead of
the NetBackup source client.
Exception error during The nbmysql restores and Verify that the disk space is larger than the MySQL
backups and restores. backups fail, if the disk space is not database and then initiate backups or restores.
sufficient for the restore and Note: Approximately 50% of space more than the
backups.
MySQL database is required for restores and
backups.
Troubleshooting for NetBackup for MySQL 33
Troubleshooting errors for the NetBackup for MySQL Agent
Even after a successful The restore operation is successful, ■ Verify that the MySQL agent and NetBackup
restore, the MySQL services, only when you restore the backup are of same version for successful restore
failed to start. on a machine that has the same operations.
minor version of MySQL. ■ Verify that the MySQL version from the backed
up data is same as the MySQL version on the
For example, if you back up a file
computer where you want to restore the data.
from MySQL version 5.5.x, then
you must restore the file to a
computer with MySQL version
5.5.x.
Appendix A
The NetBackup for MySQL
commands and
conventions
This appendix includes the following topics:
■ The parameter values that you provide on the command line takes precedence
over the nbmysql.conf file.
■ Set the operation type -o on the nbmysql command line.
■ Set the other parameters and options for the respective operation on the nbmysql
command line or the nbmysql.conf file.
The parameters on the command line take precedence over the nbmysql.conf
file.
The NetBackup for MySQL commands and conventions 35
About NetBackup for MySQL conventions
Options Descriptions
-h Displays the Help usage, when it is the only option on the nbmysql
command line.
-id Configures the specified backup using the backup image name.
-p Configures the database server port number that identifies the MySQL
instance on which the backup or restore is performed.
■ Brackets [ ] indicate that the enclosed component of the command line is optional.
Other parameters are required.
The NetBackup for MySQL commands and conventions 36
About NetBackup for MySQL conventions
■ Italics indicate that the information is user supplied. For example, you may
provide the policy name and the schedule name for a backup operation.
■ nbmysql -o backup
■ nbmysql -o restore
■ nbmysql -o query
■ nbmysql -o delete
The NetBackup for MySQL commands 38
nbmysql -o backup
nbmysql -o backup
nbmysql -o backup – runs the backup from the NetBackup client.
SYNOPSIS
nbmysql -o backup
-S master_server_name
-P policy_name
-s schedule_name
(Linux) -l mysql_library_path
[(Linux) -d MySQL_install_directory
(LVM) -z snapshot_size
[-p database_server_port]
[-u database_server_user]
Description
This command invokes the backup operation from the NetBackup client using the
NetBackup DataStore policy name and the schedule type. The parameter -S, -s
and -P are required parameters for Windows. The parameters -l and (LVM) -z
are required parameters for Linux. The -p , -u, -b, -d are the optional parameters.
Note: In non-LVM deployments, do not set the snapshot size in the -l option.
Options
-l (Linux) Configures the MySQL library directory.
-p Configures the database port number that identifies the MySQL instance on
which the backup is performed.
-P Configures the NetBackup DataStore policy name.
The NetBackup for MySQL commands 39
nbmysql -o backup
nbmysql -o restore
nbmysql -o restore – restores the backup files from the NetBackup server.
SYNOPSIS
nbmysql -o restore
-S master_server_name
-t target_directory
-p database_server_port
[-i copy_id]
[-C client_name]
Description
The nbmysql command restores the backup file using -t, -S, and -p as the required
parameters. The -i and -C are optional parameters.
On Windows systems, the directory path to this command is
install_path\NBMySQLAgent\
Options
-C Specifies the client name.
-i Specifies the backup image name.
-p Specifies the database server port.
-S Configures the NetBackup master server.
-t Configures the target directory to restore the backup.
The NetBackup for MySQL commands 41
nbmysql -o query
nbmysql -o query
nbmysql -o query – query the backups.
SYNOPSIS
nbmysql -o query
-S master_server_name
[-P policy_name]
[-C client_name]
Description
The nbmysql -o query command gets the backup using -S as the required
parameter and -C and -P as optional parameters
On Windows systems, the directory path to this command is
install_path\NBMySQLAgent\
Options
-C Retrieves and lists all backups on the specified client name.
-P Retrieves and lists all backups with the specified policy name.
-S Configures the NetBackup master server.
The NetBackup for MySQL commands 42
nbmysql -o delete
nbmysql -o delete
nbmysql -o delete – deletes the backup information from the NetBackup catalog
files.
SYNOPSIS
nbmysql -o delete
-S master_server_name
-i copy_id
Description
The nbmysql-o delete command deletes the backup images from the NetBackup
catalog files, but retains the backups in the storage media.
The parameter -S and -i are the required parameters.
Options
-i Specifies the backup using the backup image name.
-S Configures the NetBackup master server.
Index
A L
authenticating 13 LVM snapshot 32
B M
backup MySQL library 29
backup information 20
deleting 20 N
prerequisites 20
NetBackup bin directory 30
querying 20
C O
ownership 27
configuration file
parameters 15
R
redirected restore
D different file path 26
DataStore policy 18
different host 26
destination client 26
reset password 13
different file path 26
Restores
disaster recovery 27
Redirected restore 24
E S
encrypt password 13
symbolic link 11
F T
Features of NetBackup MySQL Agent 7
troubleshooting
nbmysql logs 28
H NetBackup logs 28
host ID certificate 29 NetBackup XBSA logs 28
I U
I18N file 29 uninstall 14
InnoDB 11
installing V
directory structure 9
validate password 14
installing prerequisites 9
VSS snapshot 32
user privileges 9
verifying operating systems 9