Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

NetBackup105_AdminGuide_MySQL

Uploaded by

bidaveh837
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

NetBackup105_AdminGuide_MySQL

Uploaded by

bidaveh837
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

NetBackup™ for MySQL

Administrator's Guide

Release 10.5
Last updated: 2024-09-23

Legal Notice
Copyright © 2024 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 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.

Veritas Technologies LLC


2625 Augustine Drive
Santa Clara, CA 95054

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:

Worldwide (except Japan) CustomerCare@veritas.com

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/

Veritas Services and Operations Readiness Tools (SORT)


Veritas Services and Operations Readiness Tools (SORT) is a website that provides information
and tools to automate and simplify certain time-consuming administrative tasks. Depending
on the product, SORT helps you prepare for installations and upgrades, identify risks in your
datacenters, and improve operational efficiency. To see what services and tools SORT provides
for your product, see the data sheet:

https://sort.veritas.com/data/support/SORT_Data_Sheet.pdf
Contents

Chapter 1 Overview ................................................................................ 6

Overview of NetBackup for MySQL .................................................... 6

Chapter 2 Managing MySQL instances and databases ............. 8

Quick configuration checklist to protect MySQL instances and


databases .............................................................................. 8
Configure MySQL instance .............................................................. 9
Add MySQL instance .................................................................... 11
Manage credentials for an instance .................................................. 12
Discover MySQL databases ........................................................... 12
Remove MySQL instances ............................................................. 13
Change the autodiscovery frequency of MySQL assets ........................ 13

Chapter 3 Managing MySQL environment credentials .............. 15

Add new MySQL credentials ........................................................... 15


Default MySQL Administrator .......................................................... 16
Validate credentials of MySQL instance ............................................ 17
View the credential name that is applied to an asset ............................ 17
Edit or delete a named credential ..................................................... 18

Chapter 4 Protecting MySQL instances and databases ............ 19


Things to know before you protect MySQL instances and databases
........................................................................................... 19
Protect MySQL instances and databases .......................................... 20
Customize protection settings for the MySQL assets ............................ 21
Remove protection from MySQL instances ....................................... 21
View the protection status of MySQL instance ................................... 22

Chapter 5 Restoring MySQL instances and databases ............. 23


Things to know before you restore the MySQL instances and databases
........................................................................................... 23
About the pre-restore check ............................................................ 23
Restore a MySQL instance and database ......................................... 24
Contents 5

Restore target options ................................................................... 27


Pre-restore checks for MySQL ........................................................ 27
Steps to perform recovery after restore operation ................................ 29
Limitations .................................................................................. 32

Chapter 6 Troubleshooting MySQL operations ........................... 34

Troubleshooting tips for NetBackup for MySQL ................................... 34


Error during MySQL credential addition ............................................. 35
Error during the MySQL instances and databases discovery phase
........................................................................................... 35
Error during the MySQL Protection Plan Creation ................................ 35
Error while subscribing protection plan to MySQL asset ........................ 36
Error while removing MySQL asset .................................................. 36
Error while backup of MySQL asset .................................................. 36
Error while restoring MySQL asset image ......................................... 37

Chapter 7 API for MySQL instances and databases .................. 38


Using APIs to manage, protect or restore MySQL ............................... 38
Chapter 1
Overview
This chapter includes the following topics:

■ Overview of NetBackup for MySQL

Overview of NetBackup for MySQL


NetBackup uses role-based access control to grant access to the web UI. Access
control is accomplished through roles.

Table 1-1 Steps to configure and protect MySQL assets

Step Action Description

Step 1 ■ Open a web browser and go For more information on signing in see
to the URL the Sign into the NetBackup web UI in
■ Enter your credentials and NetBackup Web UI Administrator’s Guide.
click Sign in. Note: To perform the MySQL
■ On the left, click Security > administrator tasks, the Default MySQL
RBAC. Click Add. Administrator role should have the
■ Select Default MySQL minimum required RBAC permissions.
Administrator and provide a
Role name, Role
description, and the required
permissions. Then assign a
user to this role.

Step 2 Configure and manage MySQL See “Configure MySQL instance ”


workload. on page 9.

Step 3 Add and manage credentials. See “Manage credentials for an instance”
on page 12.
Overview 7
Overview of NetBackup for MySQL

Table 1-1 Steps to configure and protect MySQL assets (continued)

Step Action Description

Step 4 Configure a MySQL protection See “Protect MySQL instances and


plan. databases” on page 20.

Step 5 Protect MySQL instances and See “Protect MySQL instances and
databases. databases” on page 20.

Step 6 Restore MySQL instances and See “Restore a MySQL instance and
databases. database ” on page 24.
Chapter 2
Managing MySQL
instances and databases
This chapter includes the following topics:

■ Quick configuration checklist to protect MySQL instances and databases

■ Configure MySQL instance

■ Add MySQL instance

■ Manage credentials for an instance

■ Discover MySQL databases

■ Remove MySQL instances

■ Change the autodiscovery frequency of MySQL assets

Quick configuration checklist to protect MySQL


instances and databases
Use NetBackup web UI to protect and restore the instances and databases that
are created on the MySQL platform.
The following table describes the high-level steps to protect the MySQL environment.
Managing MySQL instances and databases 9
Configure MySQL instance

Table 2-1 Configure and protect MySQL using NetBackup

Step overview Description and reference

Deploy the NetBackup to protect MySQL On a very high level to protect MySQL instances and databases you
instances and databases. need:

■ NetBackup primary server


■ NetBackup media server
■ NetBackup client on MySQL server

(optional) MySQL installed bin directory path Verify if MySQL installation bin path is set in environment variable. For
should be added to path environment variable. Example:

■ For Windows : PATH = C:\Program Files\MySQL\MySQL


Server 8.0\bin
■ Linux : export PATH=$PATH:/var/lib/mysql

Protecting MySQL instances and databases. See “Protect MySQL instances and databases” on page 20.

Configure MySQL instance


You can configure MySQL protection using the following environment variables:
■ (Optional) path - Add MySQL bin path to this environment variable for running
queries and connecting to databases.
■ (Optional) LIB_MYSQL_CLIENT_<port> - This environment variable is used for
MySQL multi-instance deployment.
■ For Windows set this environment variable to provide the location of
libmysql.dll library.

■ For Linux set this environment variable to provide the location of


libmysqlclient.so library.

■ (Optional) MYSQL_SOCKFILE_<port> - This environment variable is used for


MySQL multi-instance deployment. For Linux set this environment variable to
provide the location of respective instances mysql.sock file.
■ (Optional) MYSQL_BACKUP_DUMP_DIRECTORY - Set this environment
variable as temporary backup dump directory for non streaming backup. For
example, for Linux, user can set this environment variable to required location
using below command:
echo "export
MYSQL_BACKUP_DUMP_DIRECTORY=/home/custom_dump_dir_location/" > >
~/.bashrc
Managing MySQL instances and databases 10
Configure MySQL instance

For Windows, user can create new environment variable and add path of folder
location as below:
MYSQL_BACKUP_DUMP_DIRECTORY=C:\custom_dump_dir_location

Note: Ensure that provided backup dump directory is empty as post backup its
content will be auto-deleted.

■ (Optional) LVM SNAPSHOT_SIZE - Set this environment variable to provide


the snapshot size for LVM backup for Linux operating system only. You can set
environment variable of LVM Snapshot size to 500 MB using below command:
echo "export LVM_SNAPSHOT_SIZE=500MB" >> ~/.bashrc

Note: The default snapshot size is set to 500MB.

For MySQL instance configured with SSL encryption


The following environment variables on the client side, identify the certificate and
key files which clients use to establish encrypted connections to the server. These
variables are similar to the ssl_ca, ssl_cert, and ssl_key system variables which
are used on the server side whereas the following SSL environment variables
identify the client public and private key. These environment variables are required
in case of backup and recovery.
■ MYSQL_OPT_SSL_CA_port - Set this environment variable to provide the path of
the Certificate Authority (CA) certificate file. This option must specify the same
certificate used by the server. For example:
For Windows:
MYSQL_OPT_SSL_CA_3306=C:\mysql_certificate_folder\ca.pem
For Linux: echo "export
MYSQL_OPT_SSL_CA_3306=/mysql_certificate_folder/ca.pem" >>
~/.bashrc

■ MYSQL_OPT_SSL_CERT_port - Set this environment variable to provide the path


of the client public key certificate file. For example:
For Windows:
MYSQL_OPT_SSL_CERT_3306=C:\mysql_certificate_folder\client-cert.pem
For Linux: echo "export
MYSQL_OPT_SSL_CERT_3306=/mysql_certificate_folder/client-cert.pem"
>> ~/.bashrc

■ MYSQL_OPT_SSL_KEY_port - Set this environment variable to provide the path


of the client private key file. For example:
Managing MySQL instances and databases 11
Add MySQL instance

For Windows:
MYSQL_OPT_SSL_KEY_3306=C:\mysql_certificate_folder\client-key.pem
For Linux: echo "export
MYSQL_OPT_SSL_KEY_3306=/mysql_certificate_folder/client-key.pem"
>> ~/.bashrc

Add MySQL instance


You can add MySQL instance and its credentials.
To add MySQL instance and its credentials
1 On the left, click MySQL then click the Instances tab.
2 Click Add to add a MySQL instance and enter the following:
■ Host
■ Instance name

3 Enter or use the up, down arrow keys to add details of Port number.
4 Click Next.

Note: You will be redirected to the Permissions page and you can also manage
credentials of the created instance.

5 Click Finish.

Note: If you click Previous, instance created will not get saved.

Assign permissions to MySQL instance


You can assign permissions to an instance added.
To assign permissions to the MySQL instance use the following steps:
1 Click Add to add permissions to this instance.
2 Select role and permissions.
3 Click Save > Finish.

Inline actions on MySQL instance


You can run the following inline actions on a MySQL instance:
■ Recover: Recovers the MySQL instance.
Managing MySQL instances and databases 12
Manage credentials for an instance

■ Manage credentials: Manages the instance credentials.


■ Deactivate: Deactivates the MySQL instance.
■ Remove: Removes the MySQL instance.

Actions on multiple MySQL instances


You can select one or more MySQL instances and perform the following actions:
■ Deactivate: Deactivates the MySQL instances.
■ Manage credentials: Manages the credentials of the MySQL instances.
■ Remove: Removes the selected MySQL instances.
Auto-discovered cluster asset:
■ MySQL source node instance is discovered and added in web UI asset
automatically.
■ MySQL replica node instance is discovered and added in web UI asset
automatically.

Manage credentials for an instance


You can add or update credentials for instances. When you add an instance, you
can choose not to include the credentials at the time of its entry.
To add credentials for an instance at the time of its entry into the repository
1 Select Manage credentials.
2 In the Manage credentials screen, select one of the appropriate methods:
■ Select from existing credentials.
■ Add credentials.

3 Click Next.

Discover MySQL databases


You can discover MySQL databases.
To discover MySQL databases
1 On the left, click MySQL then click the Database tab.
2 Click Discover to discover a MySQL database.
Managing MySQL instances and databases 13
Remove MySQL instances

3 Select the required instance from the list of instances for which you need to
discover the databases.
4 Click Discover.

Remove MySQL instances


Use this procedure to remove MySQL instances.
To remove MySQL instances:
1 On the left, click MySQL, then click the Instances tab.

Note: The tab lists the names of instances that you have access to.

2 Select the MySQL instance from the list of instances that you have access to.
3 Select Actions > Remove or select Remove from top bar.

Note: If you remove an instance, all databases that are associated with the
removed MySQL instance will also get removed.

4 If you are sure that you want to remove the MySQL instance, click Remove.

Note: Manually remove the Instances and the associated databases which
are deleted from the MySQL Server.

Change the autodiscovery frequency of MySQL


assets
Automatic discovery of MySQL assets occurs at regular intervals. The default
frequency is every 8 hours. Use this procedure to change the autodiscovery
frequency.
To change the frequency of autodiscovery of MySQL assets:
1 On the left, click Workloads > MySQL.
2 On the right, click MySQL settings > Autodiscovery.
Managing MySQL instances and databases 14
Change the autodiscovery frequency of MySQL assets

3 Select Frequency > Edit.


4 Enter the number of hours or use the up or down arrows to choose how often
you want NetBackup to perform autodiscovery of MySQL assets. Then click
Save.

Note: The range from which you may choose is 1 hour to 24 hours. To set the
autodiscovery frequency in minutes or seconds or to disable autodiscovery,
you must use the MySQL autodiscovery API.
Chapter 3
Managing MySQL
environment credentials
This chapter includes the following topics:

■ Add new MySQL credentials

■ Default MySQL Administrator

■ Validate credentials of MySQL instance

■ View the credential name that is applied to an asset

■ Edit or delete a named credential

Add new MySQL credentials


You can add a new credential to an instance at the time of its creation. See “Manage
credentials for an instance” on page 12.
To add new MySQL credentials
1 On left, click Credential management.
2 On the Named credentials tab, click Add.
3 Provide Credential name, tag, and Description.

Note: Credential name should not contain a % character.

4 Click Next.
5 Select MySQL server from the Category drop-down.
6 Enter Instance username and Instance user password and click Next.
Managing MySQL environment credentials 16
Default MySQL Administrator

7 On the Permissions page, click Add.


8 Select role and permissions.
9 Click Save > Next.
10 Review and click Finish.

Note: You can Edit or Delete the added credentials.

Default MySQL Administrator


This role has all the permissions that are necessary to manage MySQL and to back
up those assets with protection plans.

Table 3-1 RBAC permissions for Default MySQL Administrator role

Type Permissions

Global permissions > NetBackup management

Access hosts View, Create, Delete

Agentless hosts View

Host Properties View

Media Server View

External Credential Management System View, Create, Update, Delete, External


(External CMS) CMS-Import

NetBackup hosts View, Create, Update

NetBackup backup images View, View Contents

Jobs View

Resource limits View, Create, Update, Delete

Trusted primary servers View

Global permissions > Storage

Storage servers View, Create, Update, Delete

Disk volumes View, Create, Update

Storage units View, Create, Update, Delete


Managing MySQL environment credentials 17
Validate credentials of MySQL instance

Table 3-1 RBAC permissions for Default MySQL Administrator role


(continued)

Type Permissions

Assets

MySQL assets Full permissions

Protection plans Full permissions

Credentials Full permissions

Validate credentials of MySQL instance


To validate MySQL instance credentials
You can validate a specific or multiple instance's credentials.
1 On the left, click Workloads > MySQL, then click the Instances tab.
2 Locate and select one or more MySQL instances.
3 Click Manage Credentials > Select from existing credentials.
4 Click Next and select the credentials that you want to use for this instance.
5 Click Next > Close.

Note: NetBackup verifies the current credentials for the selected MySQL instance.
If the credentials are not valid, NetBackup indicates Invalid under Credentials.
For auto-discovered cluster instances, assign credentials for MySQL source or
replica node instance.

View the credential name that is applied to an


asset
You can view the named credential that is configured for an asset type. If the
credentials are not configured for a particular asset, this field is blank.
To view credentials for MySQL
1 On the left, select Workloads > MySQL.
2 On the MySQL Instances tab, scroll right to locate the Credential name
column.
Managing MySQL environment credentials 18
Edit or delete a named credential

Edit or delete a named credential


You can edit the properties for a named credential or delete a named credential
from the Credential management.

Edit a named credential


You can edit a named credential when you want to change the credential Tag,
Description, Category, authentication details, or permissions. You cannot change
the credential name.
To edit a named credential
1 On the left, click Credential management.
2 Click Edit and update the credential as needed.

Note: When you update MySQL instances, this action automatically starts the
discovery of the MySQL instance.

3 Review the changes and click Finish.

Delete a named credential


You can delete a named credential that you no longer need to use.

Warning: Apply another credential to any asset that uses the credential you want
to delete or else backup and restore may fail for those assets.

To delete a named credential


1 On the left, click Credential management.
2 On the Named credentials tab, locate and click on the credential that you
want to delete.
3 Click Delete.
4 If you are sure that you want to delete, click Delete.
Chapter 4
Protecting MySQL
instances and databases
This chapter includes the following topics:

■ Things to know before you protect MySQL instances and databases

■ Protect MySQL instances and databases

■ Customize protection settings for the MySQL assets

■ Remove protection from MySQL instances

■ View the protection status of MySQL instance

Things to know before you protect MySQL


instances and databases
Protection plans can be used to predefine backup policies which are then used by
others to protect their data. The following table describes the permissions with which
MySQL database non-root user must be created:

Table 4-1 User Privileges

User Privileges

Instance Superuser or Select, Insert, Update, Create, Drop, Reload, Shutdown,


Administrator File, Index, Alter, Super, Lock Tables, Create View,
Show View, Trigger, Process, System_User, Create
Routine, Delete, Event, Alter Routine

To set the database user privileges, run the following command at MySQL command
line:
Protecting MySQL instances and databases 20
Protect MySQL instances and databases

GRANT SELECT, INSERT, UPDATE, CREATE, DROP, RELOAD, SHUTDOWN, FILE,


INDEX, ALTER, SUPER, LOCK TABLES, CREATE VIEW, SHOW VIEW, TRIGGER,
PROCESS, SYSTEM_USER, CREATE ROUTINE, DELETE, EVENT, ALTER ROUTINE
ON *.* TO 'USER'@'localhost' IDENTIFIED BY 'PASSWORD'

Protect MySQL instances and databases


Use the following procedure for subscribing a protection plan to MySQL instance
or database. When you subscribe an asset to a protection plan, you assign
predefined backup settings to the asset.

Note: The user with assigned RBAC role must have access to the assets that you
want to manage and also to the protection plans you want to use.

To protect MySQL instance or database:


1 On the left pane, click MySQL.
2 On the Instances tab or Databases tab, click the box for the instance or the
database and click Add protection.
3 Select a protection plan and click Next.
4 You can edit one or more of the following settings:
■ Schedules and retention
Change when backups occur and the backup start window.
Schedules
■ Full: Completes instance-backup using snapshot or mysqldump and
completes database-backup using mysqldump utility.
■ Differential Incremental: Based on previous backup timestamp,
NetBackup identify the changed set of transaction logs (Binlog files) and
perform its backup.

■ Backup options
■ Snapshot: This option is used to take the snapshot of an instance. For
Windows - VSS snapshot method is used. For Linux - LVM snapshot
method is used.
■ Mysqldump: It is an utility of MySQL which performs logical backup of
instance as well as individual database. It is recommended in case of
non-lvm deployment.
Protecting MySQL instances and databases 21
Customize protection settings for the MySQL assets

Note: Incremental backups are not supported in case of backup of individual


database.

Adjust the Database options like Job limit and Backup method.

5 Click Protect.

Note: If MySQL instance is deployed on root LVM, then Snapshot backup


method is not recommended. Also, ensure that the MySQL Data directory and
Binary Log (bin log)/Tablespace directory reside on the same LVM.
In case of cluster deployment of MySQL, instances can be protected of source
or replica node.

Customize protection settings for the MySQL


assets
To customize protection settings for the MySQL assets
You can customize certain settings for a protection plan, including schedules.
1 On the left, select Workloads > MySQL.
2 Click on the instance whose protection is to be customized.

Note: This action allows custom protection for the asset and removes it from
the original protection plan. Any future changes to the original plan are not
applied to the asset. The customization operation cannot be reversed.

3 Click Customize protection > Continue.


4 You can edit one or more of the following settings:
■ Schedules and retention
■ Backup options

5 Click Protect.

Remove protection from MySQL instances


You can unsubscribe MySQL instances from a protection plan. When the asset is
unsubscribed, backups are no longer performed.
Protecting MySQL instances and databases 22
View the protection status of MySQL instance

Note: When you unsubscribe an asset from a protection plan, there is a possibility
that the asset displays Classic policy in the Protected By column on the web UI.
This situation can happen when an asset is subscribed to a protection plan and a
backup runs for that asset. Such assets get unsubscribed from the protection plan.
The web UI then displays Classic policy, that may or may not have an active policy
protecting the asset.

To remove protection from a MySQL instance


1 On the left, click MySQL.
2 On the Instances tab, select the instance.
3 Click the instance name.
4 Click Remove protection > Yes.
Under MySQL, the asset is now listed as Not protected.

View the protection status of MySQL instance


You can view the protection plans that are used to protect MySQL instance.
To view the protection status of MySQL instance
1 On the left, click MySQL.
2 On the Instances tab, select the instance. The Protection tab shows the
details of the asset subscription plans.

Note: If the asset has been backed up, but status indicates that it has not, you
will get an error. See “Error while backup of MySQL asset” on page 36.

3 If the asset is not protected, click Add protection to select a protection plan.
Chapter 5
Restoring MySQL
instances and databases
This chapter includes the following topics:

■ Things to know before you restore the MySQL instances and databases

■ About the pre-restore check

■ Restore a MySQL instance and database

■ Restore target options

■ Pre-restore checks for MySQL

■ Steps to perform recovery after restore operation

■ Limitations

Things to know before you restore the MySQL


instances and databases
Ensure that the restore server that is added to the Netbackup environment should
have MySQL footprint on it.

About the pre-restore check


The pre-restore check verifies the following:
■ Availability of the MySQL environment.
■ Available space with the storage.
Restoring MySQL instances and databases 24
Restore a MySQL instance and database

■ In mysqldump backup, while performing restore and recovery on MySQL, the


server instance must be up and running and data directory must not be empty.
■ (For Windows) ICACLS windows command-line utility packages must be installed
and installed path must be a part of environment path variable.

Restore a MySQL instance and database


You can restore a MySQL instance or database either to an original backup location
or to an alternate location. You can choose to recover from the default copy of the
instance or database. The default copy is also known as the primary copy.
To restore a MySQL instance
1 On the left, click Workloads > MySQL.
2 On the Instances tab, select the instance that you want to recover.
3 Click Recover from the top bar.
4 On the Recovery points tab, select the date with available backup.

Note: In the calendar view, dates with available backups are indicated with a
green dot.

5 From the listed Backup images/ Recovery points, select the desired image
or recovery point.

Note: The backup images or recovery points are listed in rows with the
respective backup timestamp.

6 Click Actions > Perform complete instance recovery.


7 Click the search icon in Host field, select the desired host and click Save.
■ If the recovery is to alternate an host, then select the corresponding valid
credentials from the displayed list.
For more information, See “Restore target options” on page 27.

8 Select the appropriate instance directory path from one of the following options:
■ Restore everything to original location: Files are restored to the location
where they were originally backed up from.
■ Restore everything to a different location: Files are restored to alternative
location that you can specify. The folder structure of the restored data within
Restoring MySQL instances and databases 25
Restore a MySQL instance and database

the alternate location will be the same as that of the original data that is
same folder and sub-folder setup.
■ Directory for restore - This is MySQL data directory. MySQL full backup
data and binary logs would be restored to the specified path.

For more information, See “Restore target options” on page 27.


9 Click Next and follow the instructions prompted.
10 On the Recovery source tab, review the storage details.
11 Click Next.
12 On the Recovery points tab, select the Restore or Restore and recovery
option to perform instances and database restore and recovery:
■ Restore – Will restore the instances.
■ Restore and recovery – Will recover the instances.

Note: For LVM and VSS if Restore and Recovery option is selected, then
contents of target data directory would be deleted by recovery operation.

Note: In the Restore and recovery option, the MySQL service must be up
and running. If the service is stopped, the restore will fail. The data folder must
be empty, to run the Restore option on the same path. If the folder is not empty,
then, the data will not restored.

13 Click Next.
14 On the Review tab, review the details and click Start recovery.

Note: In case of recovery, a backup of the configuration file /etc/my.cnf with


name /etc/backup.cnf is created.

To restore a MySQL database


1 On the left, click Workloads > MySQL.
2 On the Databases tab, select the database that you want to recover.
3 Click Recover from the top bar.
Restoring MySQL instances and databases 26
Restore a MySQL instance and database

4 On the Recovery points tab, select the date with available backup.

Note: In the calendar view, dates with available backups are indicated with a
green dot.

5 From the listed Backup images/ Recovery points, select the desired image
or recovery point.

Note: The backup images or recovery points are listed in rows with the
respective backup timestamp.

6 Click Actions > Perform complete database recovery.


7 Click the search icon in Host field, select the desired host and click Save.
■ If the recovery is to alternate an host, then select the corresponding valid
credentials from the displayed list.
For more information, See “Restore target options” on page 27.
8 Select the appropriate Database directory paths from one of the following
options:
■ Restore everything to original location: Files are restored to the location
where they were originally backed up from.
■ Restore everything to a different location: Files are restored to alternative
location that you can specify. The folder structure of the restored data within
the alternate location will be the same as that of the original data that is
same folder and sub-folder setup.
■ Directory for restore – This is MySQL data directory. MySQL full backup
data and binary logs would be restored to the specified path.

For more information, See “Restore target options” on page 27.


9 Click Next and follow the instructions prompted.
10 On the Recovery source tab, review the storage details.
11 Click Next.
12 On the Recovery points tab, select the Restore or Restore and recovery
option to perform instances and database restore and recovery:
■ Restore – Will restore the database.
■ Restore and recovery – Will recover the database.
Restoring MySQL instances and databases 27
Restore target options

13 Click Next.
14 On the Review tab, review the details and click Start recovery.

Restore target options


Table 5-1 Restore target options

Step overview Description and reference

Host ■ Host field is pre-populated with the source MySQL


client stored during last successful discovery for
respective instance.
■ If you want to perform a restore on another
NetBackup client, click search and select the
required client from the list.
Note: Ensure that you select clients with
homogenous platforms.
■ If search option is unavailable, manually enter Host.

Instance directory paths ■ Change staging location on client: If you want to


provide a different staging location other than the
default staging location, enter the desired path.
Staging location path must have only ASCII
characters.
Note: Default staging location is user's home
directory.
■ Instance directory paths : Based on your
requirement, select one of the following appropriate
Instance directory paths between:
■ Restore everything to original directory
■ Restore everything to different directory
Provide different directory path to restore.

Pre-restore checks for MySQL


Table 5-2 Pre-restore checks

Validation Description and Input Source


reference

Restore client Checks for the required space Restore client


space on restore location.
Restoring MySQL instances and databases 28
Pre-restore checks for MySQL

Table 5-2 Pre-restore checks (continued)

Validation Description and Input Source


reference

Target client Checks if target client is Target client and Target client name
connectivity accessible from restore client.

Target client Checks if target client Target client alternate location


alternate location alternate location is not a
on a local disk network path.

Target client Checks if the required space Target client alternate location
location space is available on target client
alternate location.
Note: Required space is total
size of selected file with space
required for restore and space
needed for logs and other
files.

Target client Checks if provided user is an Target Target client alternate location
alternate location owner and has RBAC
permissions permissions on target client
alternate location.

Target client Checks if provided target Target client alternate location


default alternate client alternate location path
location path contains valid characters.
Non-ASCII characters are not
supported in target client
alternate location path.

Target client Checks if target client has a General


operating system supported OS.
Restoring MySQL instances and databases 29
Steps to perform recovery after restore operation

Table 5-3 Permissions for all MySQL assets

Operation Description Additional Additional


required optional
operations operations

Restore Restore backup images of MySQL asset. Global > NetBackup Assets > MySQL
management > Assets > Restore
This permission is required on MySQL.
NetBackup backup to alternate
images > View location

Global > NetBackup


management >
NetBackup backup
images > View
contents

Global > NetBackup


management >
NetBackup hosts >
View

Assets > MySQL


assets > Restore

Steps to perform recovery after restore operation


The procedure to perform post-recovery is as follows for various platforms:
For Windows (VSS):
1 Go to Control Panel > System and Security > Administrative Tools >
Services.
2 Select MySQL service and stop it.
3 Delete or move everything from the MySQL data directory.

Note: Post restores, change the attributes of the restored data directory and
files by using the following command.
attrib -S restore_path/*.* /S /D

4 Copy all the contents of the restored data directory to MySQL data directory.
Restoring MySQL instances and databases 30
Steps to perform recovery after restore operation

5 Delete all the temporary files from the data directory.


For example:
C:\ProgramData\MySQL\MySQL Server 8.0\Data\#innodb_temp.

Delete undo_00x files from the data directory:


For example:
C:\ProgramData\MySQL\MySQL Server 8.0\undo_001

6 Start MySQL service.


For Linux (LVM):
1 Stop MySQL services.
2 Copy all the contents of the restored data directory to MySQL data directory.
3 Change the ownership and permission of the MySQL data directory.
For example:
chmod -R 750 mysql_data_directory_path

chown -R mysql:mysql mysql_data_directory_path

4 Start the MySQL service.

Note: The binlogs from the incremental backups get restored to the target
directory in the MyBINLOGS directory.

Recovery steps for incremental recovery


For the recovery from incremental backups, which contain binlogs, use the following
command to replay binlogs:
■ For Windows:
for /f "tokens=*" %i in ('dir "< restore_path\MyBINLOGS" /s /b')
do (mysqlbinog "%i" | mysql -u user -P port -p)

■ For Linux:
mysqlbinlog restore_directory/MyBINLOGS/* | mysql -u user -P port
-p

Recovery Steps for backup done by mysqldump utility


Recover MySQL database using the mysqldump utility.
Restoring MySQL instances and databases 31
Steps to perform recovery after restore operation

Recover single MySQL database.


The following examples of NetBackup commands are used mostly in the Windows
and Linux platform.
■ For Windows:
mysql --host=host --user=user --port=port -p database_name <
restore_path\mysqlBackup_Dump_xxx.sqlx

■ For Linux:
mysql --host=host --user=user --port=port -p database_name <
restore_path\mysqlBackup_Dump_xxx.sqlx

Recover MySQL instance.


The following example commands create a single dump file containing all the
databases.
■ For Windows:
mysql --host=host --user=user --port=port -p <
restore_path\mysqlBackup_Dump_xxx.sqlx

■ For Linux:
mysql --host=host --user=user --port=port -p <
restore_path\mysqlBackup_Dump_xxx.sqlx

Recovery steps for incremental recovery


For doing recovery from incremental backups which contain binlogs, use the
following commands to replay the binlogs:
■ For Windows:
for /f "tokens=*" %i in ('dir restore_path/s /b') do (mysqlbinog
"%i" | mysql -u user -P port -p)

■ For Linux
mysqlbinlog restore_directory/* | mysql -u user -P port -p

Steps to perform after Restore and Recovery in case of MySQL cluster


deployment
1 For MySQL cluster deployment, follow the following steps post Restore and
Recovery:
■ For mysqldump backup, run following queries on replica:
■ STOP SLAVE;

■ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 3;


Restoring MySQL instances and databases 32
Limitations

■ START SLAVE;

2 For snapshot, do the following steps :


On source:
■ Run the command$ mysqldump -u user -p --all-databases
--master-data > source-data.sql 2.

■ Copy source-data.sql file from source to replica host in the following


ways:
■ For Linux
$ scp source_data.sql host_user@
source_ip_address:destination_path

■ For windows
Either use WinSCP or do it manually.
On replica:
■ mysql -u user -P port -p <
destimation_path_of_source-data.sql_file

■ Run the following MySQL queries:


■ On source:
■ reset master;

■ On replica:
■ stop slave;

■ reset slave;

■ reset master;

■ start slave;

Limitations
■ Cross-platform recovery of individual files is not supported. The restore client
must be the same platform as the instances that you want to restore. Windows
instances can be restored using Windows operating systems and Linux instances
can be restored only using Linux operating systems.
■ For client platform and file system support and limitations, see
https://www.veritas.com/content/support/en_US/doc/NB_70_80_VE .
■ If a backup and a restore occur simultaneously on the same database, one or
both jobs can have unexpected results.
Restoring MySQL instances and databases 33
Limitations

Note: If a backup or a restore exits with a non-zero NetBackup status code, one
possible cause is simultaneous jobs occurring on the same instance.

■ Restore job fails, if NetBackup does not have sufficient privileges or if there is
insufficient space in the client memory.
■ NetBackup does not support non-ASCII characters in target client location path.
Chapter 6
Troubleshooting MySQL
operations
This chapter includes the following topics:

■ Troubleshooting tips for NetBackup for MySQL

■ Error during MySQL credential addition

■ Error during the MySQL instances and databases discovery phase

■ Error during the MySQL Protection Plan Creation

■ Error while subscribing protection plan to MySQL asset

■ Error while removing MySQL asset

■ Error while backup of MySQL asset

■ Error while restoring MySQL asset image

Troubleshooting tips for NetBackup for MySQL


For more information about MySQL troubleshooting, check the following details:
■ For discovery failures:
■ Check the ncfnbcs log.

■ For backup job failures:


■ Check the bprd, bprm, bphdb and nbmysql logs.

■ For restore job failures:


■ Check the bprd, bprm and tar logs.
Troubleshooting MySQL operations 35
Error during MySQL credential addition

Error during MySQL credential addition


Table 6-1 Error during MySQL credential addition

Error message or cause Explanation and recommended action

Credential validation failed. The host’s name is not valid NetBackup client. Ensure that
Provide correct host name. the hostname is registered client of NetBackup and it is
whitelisted.

Error during the MySQL instances and databases


discovery phase
The following table describes the problem that might occur when you try to discover
MySQL database.

Table 6-2 Error run into during the MySQL instance and database discovery
phase

Error message or cause Explanation and recommended action

The MySQL assets are not discovered Run discover database and retry the database discovery manually.
after the correct MySQL instances
■ Ensure that the update permission assigned to the logged in web UI user.
credentials are added.
■ Contact Veritas Technical support and share nbwebservice logs from
NetBackup master server and ncfnbcs logs from NetBackup client.

Error during the MySQL Protection Plan Creation


The following table describes the problem that might occur while creating protection
plan for MySQL workload.

Table 6-3 Error during the MySQL Protection Plan Creation

Error message or cause Explanation and recommended action

A plan with this name already Protection plan with same name is already present.
exists.
■ Please create protection plan with another name.

Storage disk pool is not Before adding protection, we need to add storage Unit.
present
■ Please add Storage Unit from Storage Configuration
>Add.
Troubleshooting MySQL operations 36
Error while subscribing protection plan to MySQL asset

Error while subscribing protection plan to MySQL


asset
The following table describes the problem that might occur during subscribing
protection plan to a MySQL asset.

Table 6-4 Error while subscribing protection plan to a MySQL asset

Error message or cause Explanation and recommended action

This subscription must be If subscription has been already modified, the below warning
reset to protection plan message will be displayed.
defaults before it can be
■ User can reset subscription using 'Restore original
customized.
settings' button and then try to customize subscription
again.

Storage disk pool is not Before adding protection, we need to add storage Unit.
present
■ Please add Storage Unit from Storage Configuration
>Add.

Error while removing MySQL asset


Table 6-5 Error while removing MySQL Asset

Error message or cause Explanation and recommended action

Removed 0 of 1 instance. If protection plan is attached to MySQL asset, then we cannot


delete such an asset.

■ First unsubscribe protection plan from asset and then


delete the asset.

Error while backup of MySQL asset


The following table describes the problem that might occur when you back up
MySQL asset. Backup jobs fail with error code 6.
Troubleshooting MySQL operations 37
Error while restoring MySQL asset image

Table 6-6 Error while backing up MySQL assets

Error message or cause Explanation and recommended action

Failed to backup the requested files. Verify the MySQL service is up and running
on client.

■ Contact Veritas Technical support and


share bphdb and nbmysql logs from
backup client.

SSL connection error: ■ Verify the connection to MySQL instance


SSL_CTX_set_default_verify_paths works with the provided SSL certificates.
failed ■ Assign valid certificates to the SSL
environment variables.
■ Verify the permissions and owner
assigned to certificates.

Error while restoring MySQL asset image


The following table describes the problem that might occur when you restore MySQL
asset.

Table 6-7 Error while restore of MySQL asset image

Error message or cause Explanation and recommended action

Unable to change the Host while If you cannot see the list of the host, you might not have access to NetBackup
modifying the restore Host in RBAC.
target/destination.
■ Contact the NetBackup security administrator to resolve this issue.

Restore failed with below error: If the database user provided for restore operation is different from the backup
Restore initiated from XBSA Failed to operation database user. The permission of file differs in the NetBackup file
query the object... 17 system and hence restore fails.

■ Use the same database user for restore which was used while taking
backup of asset, so that file system permissions will be available to the
restore user as well.

Restore Image not found at alternate No image was found on recovery host alternate location
location on recovery host.
■ Contact Veritas Technical support and share tar log from the recovery
host.
Chapter 7
API for MySQL instances
and databases
This chapter includes the following topics:

■ Using APIs to manage, protect or restore MySQL

Using APIs to manage, protect or restore MySQL


This topic lists the APIs to manage, protect or restore the MySQL instances and
databases. Only the important variables and options are mentioned in this topic.
Following sections are part of this topic:
■ See the section called “Add a MySQL instance” on page 39.
■ See the section called “MySQL Discovery API” on page 39.
■ See the section called “Create a MySQL Protection Plan” on page 40.
■ See the section called “MySQL Recovery point Service API ” on page 40.
■ See the section called “Restore the MySQL instance and database at the original
location ” on page 41.
■ See the section called “Restore the MySQL instance and database to an alternate
location ” on page 41.
For detailed information on the APIs, use these references:
■ All the NetBackup APIs are listed at the following location:
Services and Operations Readiness Tools (SORT) > Knowledge Base >
Documents
API for MySQL instances and databases 39
Using APIs to manage, protect or restore MySQL

Add a MySQL instance


Table 7-1 Add a MySQL instance

API Important variables and options

POST ■ clientName is the name of the MySQL instance.


/netbackup/asset-service/queries ■ sqlHostName is hostname of a NetBackup client.
■ credentialName are credentials associated with MySQL
GET
instance.
/netbackup/asset-service/queries/{aqcId}
Note: The credential must exist with credentialName
GET mentioned.
/netbackup/asset-service/workloads
/mysql/assets ■ port is port number of MySQL instance.

MySQL Discovery API


Table 7-2 Discover the MySQL asset for given client

API Important variables and options

POST ■ serverName is used to identify instance or database


/netbackup/admin/discovery ■ discoveryHost is hostname where discovery needs to
/workloads/mysql/start be triggered
■ allclientsdiscovery triggers discovery for all the
POST
clients host associated with the master.
/netbackup/admin/discovery/workloads
/mysql/stop

GET
/netbackup/admin/discovery/workloads
/mysql/status

POST
/netbackup/admin/discovery/workloads
/mysql/allclientsdiscovery
API for MySQL instances and databases 40
Using APIs to manage, protect or restore MySQL

Create a MySQL Protection Plan


Table 7-3 Create a MySQL Protection Plan

API Important variables and options

■ policyType is DataStore.
POST ■ Add scheduleName can have values like FULL_AUTO
/netbackup/servicecatalog/slos or INCR_AUTO for adding MySQL instance.
■ keyword can have the following values to back up an
instance or database using different backup options:
POST
/netbackup/servicecatalog/slos/{sloId} • mysqldump
/subscriptions • Snapshot
■ sloId is the identifier to protection plan
■ selectionId is the AssetId which needs to be
POST subscribed with given sloId
/netbackup/servicecatalog/slos/{sloId}
/backup-now

After you create a protection plan, other processes like creating the schedule for
the policy or triggering the policy backup remain the same.

MySQL Recovery point Service API


Table 7-4 MySQL asset backup instances available for recovery

API Important variables and options

GET ■ backupId is identifier that was used at the time of backup.


/netbackup/recovery-point-service ■ assetId is identifier that was used to identify instance or
/workloads/mysql/recovery-points database.
■ client hostname is name of backup client.
GET
/netbackup/recovery-point-service
/workloads/mysql/recovery-points
/{backupId}

GET
/netbackup/wui/workloads/mysql
/recovery-point-calendar-summary
API for MySQL instances and databases 41
Using APIs to manage, protect or restore MySQL

Restore the MySQL instance and database at the original


location
Table 7-5 Restore the MySQL instance and database at the original location

API Important variables and options

POST ■ backupId is identifier that was used at the time of backup.


/netbackup/recovery/workloads/mysql/ ■ assetId is identifier that was used to identify instance or
scenarios/instance-complete-recovery database.
/recover ■ Client is server that is to be used as the MySQL
recovery host to perform this recovery. Set the following
POST
value:
/netbackup/recovery/workloads/mysql
/scenarios/database-complete-recovery renameAllFilesToSameLocation
/recover

Restore the MySQL instance and database to an alternate


location
Table 7-6 Restore the MySQL instance and database to an alternate
location

API Important variables and options

POST ■ backupId is identifier that was used at the time of backup.


/netbackup/recovery/workloads/mysql/ ■ assetId is identifier that was used to identify instance or
scenarios/instance-complete-recovery database.
/recover ■ Client is server that is to be used as the MySQL
recovery host to perform this recovery. Set the following
POST
value:
/netbackup/recovery/workloads/mysql
/scenarios/database-complete-recovery renameEachFileToDifferentLocation
/recover

You might also like