Managing Databases

This chapter contains the following sections:

Working with Databases

This section describes how to enable, start and stop, as well as backup and restore a database.

Stopping the Database

You can halt the mariadb daemon (mariadbd) by choosing the Stop Database option. This option stops all of the following Cisco services:

  • Broker

  • Controller

  • Eventmgr

  • Client

  • Idaccessmgr

  • Inframgr

  • Websock (VNC interface)

  • Tomcat

  • Flashpolicyd

Procedure


Step 1

From the Cisco UCS Director Shell menu, choose the Stop Database option.

The following information is displayed:

Do you want to stop database [y/n]? y
Stopping infra services...
Stopping services...
Stopping service broker...                   [DOWN]
Stopping service controller...               [DOWN]
Stopping service eventmgr...                 [DOWN]
Stopping service idaccessmgr...              [DOWN]
Stopping service inframgr...                 [DOWN]
Stopping service websock...                  [DOWN]
Stopping service connectormgr...             [DOWN]
Stopping service tomcat...                   [DOWN]
Stopping service flashpolicyd...             [DOWN]
Stopping services... done
Stopping database...
The database is stopped.
Database stopped
Press return to continue ...
Step 2

Choose Display Service Status option to verify that the Cisco services have been stopped on the database.

The database status displays as down with no connections.

Starting the Database

You can start the mariadb daemon (mariadbd) by choosing the Start Database option.


Note

This option starts the appliance database only.


Procedure


Step 1

From the Cisco UCS Director Shell menu, choose the Start Database option.

Step 2

Press Enter.

The following information is displayed:
Starting database...
Checking if MariaDB database is running... ..................UP
Database started.
Press return to continue ...
Note 

The Cisco services are not started automatically when you start the appliance database. Choose the Start Services option to start the Cisco services.

Step 3

Choose Display Service Status option to verify that the Cisco services have been started on the database.

The database status displays as up and list the number of connections.

Backing Up the Database

You can backup the appliance database to an FTP, SFTP, or SCP server.

You need the following information in order to execute the task:

  • FTP, SFTP, or SCP server's IP address (from where the database is backed up)

  • Server's IP address (where the database is backed up)

  • Server's login credentials


Note

After the server credentials are provided, the entire database of the Cisco UCS Director appliance is backed up at the specified server location. You then can start the Cisco services by choosing the Start Services option.


Before you begin

Stop the Cisco services by using the Cisco UCS Director Shell Stop Services option.

Procedure


Step 1

If you have not already done so, stop the Cisco services by using the Stop Services option. Refer to the Shell documentation about using that option.

Step 2

From the Cisco UCS Director Shell menu, choose the Backup Database option and press Enter.

The following information is displayed:
Services will be stopped before Database Backup. Do you want to continue [y/n]?
Step 3

Enter y and press Enter.

The following information is displayed:

Stopping services...

Stopping services... done
Taking local Database backup...
The backup process creates a <filename>.tar.gz file on the system running Cisco UCS Director.
This file will be copied to another server using the ftp, sftp, or scp protocol.
Specify the transfer mode and login credentials.

   Specify the Transfer mode [ftp sftp scp]:
Step 4

Enter your mode of transfer and login credentials, and press Enter.

The following information is displayed:

Server IP Address: 
Step 5

Enter Server IP address and press Enter.

The following information is displayed:

Server IP Address: xxx.xxx.xxx.xxx
Server Login: 
Step 6

Enter your Server login name and press Enter.

Step 7

Enter your Server password and press Enter.

Note 

For SFTP server, you can also store the backup files in the sub-directory. By default, the files are stored in the Home directory.

Note 

For SCP, you need to provide the complete path to store the backup files.


Messages appear to confirm the progress of your backup.

Restoring the Database

Before restoring the database, stop the Cisco services. To stop the services, choose the Stop Services option. Provide the following information in order to execute the task:

  • FTP, SFTP, or SCP server's IP address (from where the database is restored)

  • Server's login credentials

  • Restore filename

  • Confirm to restore


Note

After server credentials are provided, the entire database of the Cisco UCS Director appliance is restored from the specified server location. You can then start the Cisco services by choosing the Start Services option.


Procedure


Step 1

From the Cisco UCS Director Shell menu, choose the Restore Services option and press Enter.

The following information is displayed:
Services will be stopped before Database Backup. Do you want to continue [y/n]?
Step 2

Enter y and press Enter.

The following information is displayed:

Stopping services... done
The restore process restores the database from a backed up <filename>.tar.gz file
on the system running Cisco UCS Director.
You can copy this file from another server using the ftp, sftp, or scp mode.

   Specify the Transfer mode [ftp sftp scp]:
Step 3

Enter your mode of transfer and login credentials, and press Enter.

The following information displays:
 
 Provide the necessary access credentials
Server IP Address:
Step 4

Enter your server IP address and press Enter.

The following information displays:
 
Server Login:
Step 5

Enter your server login and press Enter.

Step 6

Enter your server password and press the Enter.

Step 7

Follow the onscreen prompts to complete the process.

Step 8

Choose the Start Services option to restart the Cisco services.