Veritas Netbackup™ For Mysql Administrator'S Guide: Windows and Linux
Veritas Netbackup™ For Mysql Administrator'S Guide: Windows and Linux
MySQL Administrator's
Guide
Release 8.1.1
Documentation version: 8.1.1
Legal Notice
Copyright © 2018 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. 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.
Veritas Technologies LLC
500 E Middlefield Road
Mountain View, CA 94043
http://www.veritas.com
.
Technical Support
Technical Support maintains support centers globally. Technical Support’s primary
role is to respond to specific queries about product features and functionality. The
Technical Support group also creates content for our online Knowledge Base. The
Technical Support group works collaboratively with the other functional areas within
the company to answer your questions in a timely fashion.
Our support offerings include the following:
■ A range of support options that give you the flexibility to select the right amount
of service for any size organization
■ Telephone and/or Web-based support that provides rapid response and
up-to-the-minute information
■ Upgrade assurance that delivers software upgrades
■ Global support purchased on a regional business hours or 24 hours a day, 7
days a week basis
■ Premium service offerings that include Account Management Services
For information about our support offerings, you can visit our website at the following
URL:
www.veritas.com/support
All support services will be delivered in accordance with your support agreement
and the then-current enterprise technical support policy.
Customer service
Customer service information is available at the following URL:
www.veritas.com/support
Customer Service is available to assist with non-technical questions, such as the
following types of issues:
■ Questions regarding product licensing or serialization
■ Product registration updates, such as address or name changes
■ General product information (features, language availability, local dealers)
■ Latest information about product updates and upgrades
■ Information about upgrade assurance and support contracts
■ Advice about technical support options
■ Nontechnical presales questions
■ Issues that are related to CD-ROMs, DVDs, or manuals
Support agreement resources
If you want to contact us regarding an existing support agreement, please contact
the support agreement administration team for your region as follows:
Index .................................................................................................................... 42
Chapter 1
Introduction to NetBackup
for MySQL Agent
This chapter includes the following topics:
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 16.
User Privileges
■ NBMySQLAgent_8.1_AMD64/NBMySQLAgent.msi
■ NBMySQLAgent_8.1_AMD64/Setup.exe
■ NBMySQLAgent_8.1_AMD64/CAB1.CAB
■ NBMySQLAgent_8.1_linuxR_x86/install
■ NBMySQLAgent_8.1_linuxR_x86/LICENSE
■ NBMySQLAgent_8.1_linuxR_x86/pkg.tar
■ NBMySQLAgent_8.1_linuxS_x86/install
■ NBMySQLAgent_8.1_linuxS_x86/LICENSE
■ NBMySQLAgent_8.1_linuxS_x86/pkg.tar
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/
Installing NetBackup for MySQL Agent 16
Installing the NetBackup for MySQL Agent
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 --login-path=<portnumber> --password
3 To reset the password, run the command that applies to your operating system:
■ (Windows) mysql_config_editor.exe reset
■ (Linux) mysql_config_editor reset
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. and when not specified, operations. database user name, it
then the default value is "root". defaults to root.
DB_PORT Configures the MySQL database Restore operations When you do not set this
server port number on which the database server port, it
backup or the restore should be defaults to 3306.
performed.
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. If you do not specify
a measurement, the default
measurement is M (megabytes).
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.
Configuring NetBackup for MySQL Agent 20
Configuring NetBackup for MySQL backups with DataStore policies
MYSQL_TARGET_DIRECTORY Specifies the destination directory Restore backups. No default value for this
where you want to restore the parameter.
backups.
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 nbmysql log size, it
reaches the specified size, it to the events that defaults to 10MB.
overwrites the log information. you want to write
into the logs.
Note: The XBSA framework supports the Default 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.
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 18.
Chapter 4
The NetBackup for MySQL
backups and restores
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.
■ (LVM users) Ensure that MySQL data and logs directory reside on the logical
volumes.
■ Configure the DataStore policy from the NetBackup Administration Console.
■ Add the database parameters and library path in the nbmysql.conf file.
The NetBackup for MySQL backups and restores 24
Validating the backup information
■ 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 13.
For more information, See “Post-installation requirements for NetBackup for
MySQL Agent ” on page 14.
To run the backup
1 Run the following command:
nbmysql -o backup
-S master_server_name
-P policy_name
-s schedule_name
-l mysql_lib_path
-z snapshot_size
[-p database_server_port]
[-u database_username]
2 (Optional) Type the password, when the nbmysql command line prompts for
the password.
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
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.
Prerequisites
Before you restore the backups, you must meet the following prerequisites:
■ 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 18.
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]
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.
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]
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]
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 27.
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 30
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.
NetBackup MySQL 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.
■ MySQL library file location. For more information, See “The nbmysql
■ The configuration file” on page 18.
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 14.
Troubleshooting for NetBackup for MySQL 31
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 18.
■ 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 MySQL 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 18.
■ Verify if there are communication errors
between the MySQL agent and the NetBackup
master server. For more information see the
NetBackup Administration guide.
Troubleshooting for NetBackup for MySQL 32
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 18.
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.
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.
■ Italics indicate that the information is user supplied. For example, you may
provide the policy name and the schedule name for a backup operation.
The NetBackup for MySQL commands and conventions 36
About NetBackup for MySQL conventions
■ 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
(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 and -u are the optional parameters.
On Linux systems, the directory path is /usr/NBMySQLAgent/
On Windows, the directory path is install_path\NBMySQLAgent\
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.
-S Configures the NetBackup server name.
-s Specifies the schedule name that you have configured for the DataStore
policy.
-u Configures the database user name.
-z (LVM backups) Specifies the LVM snapshot size.
The NetBackup for MySQL commands 39
nbmysql -o restore
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 40
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 41
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 16 LVM snapshot 33
B M
backup MySQL library 30
backup information 22
deleting 22 N
prerequisites 22
NetBackup bin directory 31
querying 22
C O
ownership 28
configuration file
parameters 18
R
redirected restore
D different file path 27
DataStore policy 20
different host 27
destination client 27
reset password 17
different file path 28
Restores
disaster recovery 28
Redirected restore 26
E S
encrypt password 17
symbolic link 14
F T
Features of NetBackup MySQL Agent 10
troubleshooting
nbmysql logs 29
H NetBackup logs 29
host ID certificate 30 NetBackup XBSA logs 29
I U
I18N file 30 uninstall 17
InnoDB 13
installing V
directory structure 12
validate password 17
installing prerequisites 12
VSS snapshot 33
user privileges 12
verifying operating systems 12