openstack-manuals/doc/user-guide/source/dashboard_databases.rst
Andreas Jaeger 28d95bfc66 End User Guide: Remove user_only and orphan
With the split of the User Guides, there's no need anymore to have
orphan and user_only flags, remove them from the user-guide
directory.

Only files that keep :orphan: are
doc/user-guide/source/hot-guide/hot_advanced_topics.rst and
hot_existing_templates.rst since these files are not currently included.

Change-Id: I1ac0356d69d8668785f8b1947e8b061731aca747
2015-05-13 18:09:16 +00:00

6.3 KiB

Create and manage databases

The Database service provides scalable and reliable cloud provisioning functionality for both relational and non-relational database engines. Users can quickly and easily use database features without the burden of handling complex administrative tasks.

Create a database instance

Prerequisites. Before you create a database instance, you need to configure a default datastore and make sure you have an appropriate flavor for the type of database instance you want.

  1. Configure a default datastore.

    Because the dashboard does not let you choose a specific datastore to use with an instance, you need to configure a default datastore. The dashboard then uses the default datastore to create the instance.

    1. Add the following line to /etc/trove/trove.conf:

      default_datastore = DATASTORE_NAME

      Replace ``DATASTORE_NAME`` with the name that the administrative user set when issuing the trove-manage command to create the datastore. You can use the trove datastore-list command to display the datastores that are available in your environment.

      For example, if your MySQL datastore name is set to mysql, your entry would look like this:

      default_datastore = mysql
    2. Restart Database services on the controller node:

      # service trove-api restart
      # service trove-taskmanager restart
      # service trove-conductor restart
  2. Verify flavor.

    Make sure an appropriate flavor exists for the type of database instance you want.

Create database instance. Once you have configured a default datastore and verified that you have an appropriate flavor, you can create a database instance.

  1. Log in to the dashboard, choose a project, and click Databases.

  2. Click Database Instances. This lists the instances that already exist in your environment.

  3. Click Launch Instance.

  4. In the Launch Database dialog box, specify the following values.

    Details

    Database Name: Specify a name for the database instance.

    Flavor: Select an appropriate flavor for the instance.

    Volume Size: Select a volume size. Volume size is expressed in GB.

    Initialize Databases: Initial Database

    Optionally provide a comma separated list of databases to create, for example:

    database1, database2, database3

    Initial Admin User: Create an initial admin user. This user will have access to all the databases you create.

    Password: Specify a password associated with the initial admin user you just named.

    Host: Optionally, allow the user to connect only from this host. If you do not specify a host, this user will be allowed to connect from anywhere.

  5. Click the Launch button. The new database instance appears in the databases list.

Backup and restore a database

You can use Database services to backup a database and store the backup artifact in the Object Storage module. Later on, if the original database is damaged, you can use the backup artifact to restore the database. The restore process creates a database instance.

This example shows you how to back up and restore a MySQL database.

To backup the database instance

  1. Log in to the dashboard, choose a project, and click Databases.

  2. Click Database Instances. This displays the existing instances in your system.

  3. Click Create Backup.

  4. In the Backup Database dialog box, specify the following values:

    Name

    Specify a name for the backup.

    Database Instance

    Select the instance you want to back up.

  5. Click Backup. The new backup appears in the backup list.

To restore a database instance

Now assume that your original database instance is damaged and you need to restore it. You do the restore by using your backup to create a new database instance.

  1. Log in to the dashboard, choose a project, and click Databases.

  2. Click Database Backups. This lists the available backups.

  3. Check the backup you want to use and click Restore Backup.

  4. In the Launch Database dialog box, specify the values you want for the new database instance.

  5. Click the Restore From Database tab and make sure that this new instance is based on the correct backup.

  6. Click Launch.

    The new instance appears in the database instances list.

Update a database instance

You can change various characteristics of a database instance, such as its volume size and flavor.

To change the volume size of an instance

  1. Log in to the dashboard, choose a project, and click Databases.
  2. Click Database Instances. This displays the existing instances in your system.
  3. Check the instance you want to work with. In the Actions column, expand the drop down menu and select Resize Volume.
  4. In the Resize Database Volume dialog box, fill in the New Size field with an integer indicating the new size you want for the instance. Express the size in GB, and note that the new size must be larger than the current size.
  5. Click Resize Database Volume.

To change the flavor of an instance

  1. Log in to the dashboard, choose a project, and click Databases.
  2. Click Database Instances. This displays the existing instances in your system.
  3. Check the instance you want to work with. In the Actions column, expand the drop down menu and select Resize Instance.
  4. In the Resize Database Instance dialog box, expand the drop down menu in the New Flavor field. Select the new flavor you want for the instance.
  5. Click Resize Database Instance.