6be4f5775f
The XML root element of Docbook XML files should match the following format: <ELEMENT xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="THE_XML_ID_OF_THE_ELEMENT"> Change-Id: Ic59684221ba99632c71e3f9b5f97ec74f56793a4
485 lines
35 KiB
XML
485 lines
35 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE chapter [
|
|
<!ENTITY % openstack SYSTEM "../common/entities/openstack.ent">
|
|
%openstack;
|
|
]>
|
|
<section xmlns="http://docbook.org/ns/docbook"
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
version="5.0"
|
|
xml:id="trove-manage-db">
|
|
<?dbhtml stop-chunking?>
|
|
<title>Create and manage databases</title>
|
|
<para>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.</para>
|
|
<section xml:id="create_db">
|
|
<title>Create and access a database</title>
|
|
<para>Assuming you have already installed the Database service and stocked your datastore with images for the type and versions of databases you want, you can create and access a database. This example shows you how to create and access a MySQL 5.5 database.</para>
|
|
<procedure>
|
|
<title>To create and access a database</title>
|
|
<step>
|
|
<formalpara>
|
|
<title>Determine the flavor to use for your database.</title>
|
|
<para>When you create a database instance, you must specify a nova flavor. The flavor indicates various characteristics of the instance, such as RAM, root volume size, and so on. The default nova flavors do not cover what you need for database instances. Therefore, you may need to create (or obtain) some new nova flavors that will work for databases.</para>
|
|
</formalpara>
|
|
<para>The first step is to list the existing flavors, using the nova <command>flavor-list</command> command. Here are the default flavors, although you may have additional custom flavors in your environment:</para>
|
|
<screen><prompt>$</prompt> <userinput>nova flavor-list</userinput>
|
|
<computeroutput>+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
|
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
|
|
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
|
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
|
|
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
|
|
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
|
|
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
|
|
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
|
|
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
|
</computeroutput></screen>
|
|
<para>Now take a look at the minimum requirements for various database instances:</para>
|
|
<informaltable rules="all" width="60%">
|
|
<col width="25%"/>
|
|
<col width="25%"/>
|
|
<col width="25%"/>
|
|
<col width="25%"/>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>Database</th>
|
|
<th>RAM (in MB)</th>
|
|
<th>Disk (in GB)</th>
|
|
<th>VCPUs</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<para>MySQL</para>
|
|
</td>
|
|
<td>
|
|
<para>512</para>
|
|
</td>
|
|
<td>
|
|
<para>5</para>
|
|
</td>
|
|
<td>
|
|
<para>1</para>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<para>Cassandra</para>
|
|
</td>
|
|
<td>
|
|
<para>2048</para>
|
|
</td>
|
|
<td>
|
|
<para>5</para>
|
|
</td>
|
|
<td>
|
|
<para>1</para>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<para>MongoDB</para>
|
|
</td>
|
|
<td>
|
|
<para>1024</para>
|
|
</td>
|
|
<td>
|
|
<para>5</para>
|
|
</td>
|
|
<td>
|
|
<para>1</para>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<para>Redis</para>
|
|
</td>
|
|
<td>
|
|
<para>512</para>
|
|
</td>
|
|
<td>
|
|
<para>5</para>
|
|
</td>
|
|
<td>
|
|
<para>1</para>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</informaltable>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>If you have a custom flavor that meets the needs of the database you want to create, you can simply use that flavor. In this case, skip the rest of this step and move on to the next step in this procedure.</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>If your environment does not have a suitable flavor, an admin user needs to create a custom flavor, using the nova <command>flavor-create</command> command.</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<formalpara><title>MySQL example.</title> <para>This example creates a flavor that you can use with a MySQL database. This example has the following attributes:</para></formalpara>
|
|
<itemizedlist>
|
|
<listitem><para>Flavor name: <literal>mysql_minimum</literal></para></listitem>
|
|
<listitem><para>Flavor ID: You need to use an ID that is not already in use. In this example, IDs 1 through 5 are already in use, so the ID can be <literal>6</literal>.</para></listitem>
|
|
<listitem><para>RAM: <literal>512</literal></para></listitem>
|
|
<listitem><para>Root volume size in GB: <literal>5</literal></para></listitem>
|
|
<listitem><para>Virtual CPUs: <literal>1</literal></para></listitem>
|
|
</itemizedlist>
|
|
<screen><prompt>$</prompt> <userinput>nova flavor-create mysql-minimum 6 512 5 1</userinput>
|
|
<computeroutput>+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
|
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
|
|
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
|
| 6 | mysql-minimum | 512 | 5 | 0 | | 1 | 1.0 | True |
|
|
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
|
</computeroutput></screen>
|
|
</step>
|
|
|
|
<step>
|
|
<formalpara>
|
|
<title>Create a database instance.</title>
|
|
<para>This example creates a database instance with the following characteristics:</para>
|
|
</formalpara>
|
|
<itemizedlist>
|
|
<listitem><para>Name of the instance: <literal>mysql_instance_1</literal></para></listitem>
|
|
<listitem><para>Database flavor: <literal>6</literal></para></listitem>
|
|
</itemizedlist>
|
|
<para>In addition, this command uses various options to specify that:</para>
|
|
<itemizedlist>
|
|
<listitem><para>The instance has a volume size of <literal>5</literal> (meaning 5 GB).</para></listitem>
|
|
<listitem><para>It has a database called <literal>myDB</literal>.</para></listitem>
|
|
<listitem><para>It has a user called <literal>userA</literal> with a password of <literal>password</literal>.</para></listitem>
|
|
<listitem><para>The database is based on a datastore called <literal>mysql</literal> and a datastore_version called <literal>mysql-5.5</literal>.</para></listitem>
|
|
</itemizedlist>
|
|
<screen><prompt>$</prompt> <userinput>trove create mysql_instance_1 6 --size 5 --databases myDB \
|
|
--users userA:password --datastore_version mysql-5.5 \
|
|
--datastore mysql</userinput>
|
|
<computeroutput>+-------------------+---------------------------------------------------------------------------------------t------------------------------------------------------------------------------------------------------------------+
|
|
| Property | Value |
|
|
+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| created | 2014-05-29T21:26:21 |
|
|
| datastore | {u'version': u'mysql-5.5', u'type': u'mysql'} |
|
|
| datastore_version | mysql-5.5 |
|
|
| flavor | {u'id': u'6', u'links': [{u'href': u'https://controller:8779/v1.0/46d0bc4fc32e4b9e8520f8fc62199f58/flavors/6', u'rel': u'self'}, {u'href': u'https://controller:8779/flavors/6', u'rel': u'bookmark'}]} |
|
|
| id | 5599dad6-731e-44df-bb60-488da3da9cfe |
|
|
| name | mysql_instance_1 |
|
|
| status | BUILD |
|
|
| updated | 2014-05-29T21:26:21 |
|
|
| volume | {u'size': 5} |
|
|
+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
</computeroutput></screen>
|
|
</step>
|
|
|
|
<step>
|
|
<formalpara>
|
|
<title>Get the IP address of the database instance.</title>
|
|
<para>First, use the trove <command>list</command> command to list all instances and their IDs:</para>
|
|
</formalpara>
|
|
<screen><prompt>$</prompt> <userinput>trove list</userinput>
|
|
<computeroutput>
|
|
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
|
| id | name | datastore | datastore_version | status | flavor_id | size |
|
|
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
|
| 5599dad6-731e-44df-bb60-488da3da9cfe | mysql_instance_1 | mysql | mysql-5.5 | BUILD | 6 | 5 |
|
|
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
|
</computeroutput></screen>
|
|
<para>This command returns the instance ID of your new instance. You can now pass in the instance ID with the trove <command>show</command> command to get the IP address of the instance. In this example, you would replace <replaceable>INSTANCE_ID</replaceable> with 5599dad6-731e-44df-bb60-488da3da9cfe.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove show <replaceable>INSTANCE_ID</replaceable></userinput>
|
|
<computeroutput>+-------------------+--------------------------------------+
|
|
| Property | Value |
|
|
+-------------------+--------------------------------------+
|
|
| created | 2014-05-29T21:26:21 |
|
|
| datastore | mysql |
|
|
| datastore_version | mysql-5.5 |
|
|
| flavor | 6 |
|
|
| id | 5599dad6-731e-44df-bb60-488da3da9cfe |
|
|
| ip | 172.16.200.2 |
|
|
| name | mysql_instance_1 |
|
|
| status | BUILD |
|
|
| updated | 2014-05-29T21:26:54 |
|
|
| volume | 5 |
|
|
+-------------------+--------------------------------------+
|
|
|
|
</computeroutput></screen>
|
|
<para>This command returns the IP address of the database instance.</para>
|
|
</step>
|
|
|
|
<step>
|
|
<formalpara>
|
|
<title>Access the new database.</title>
|
|
<para>You can now access the new database you just created (myDB) using typical database access commands. In this MySQL example, you would replace <replaceable>IP_ADDRESS</replaceable> with 172.16.200.2.</para>
|
|
</formalpara>
|
|
<screen><prompt>$</prompt> <userinput>mysql -u userA -ppassword -h <replaceable>IP_ADDRESS</replaceable> myDB</userinput></screen>
|
|
</step>
|
|
</procedure>
|
|
</section>
|
|
<section xml:id="backup_db">
|
|
<title>Backup and restore a database</title>
|
|
<para>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 new database instance.</para>
|
|
<para>This example shows you how to backup and restore a MySQL database.</para>
|
|
<procedure>
|
|
<title>To backup and restore a database</title>
|
|
<step>
|
|
<formalpara>
|
|
<title>Backup the database instance.</title>
|
|
<para>As background, assume that you have <link linkend="create_db">created a database instance</link> with the following characteristics:</para>
|
|
</formalpara>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>Name of the database instance: <literal>guest1</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Flavor ID: <literal>10</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Root volume size: <literal>2</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Databases: <literal>db1</literal> and <literal>db2</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Users: One user named <literal>user1</literal> with a password of <literal>password</literal></para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<para>First, get the ID of the <literal>guest1</literal> database instance by using the trove <command>list</command> command:</para>
|
|
<screen><prompt>$</prompt> <userinput>trove list</userinput>
|
|
<computeroutput>+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
|
| id | name | datastore | datastore_version | status | flavor_id | size |
|
|
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
|
| 97b4b853-80f6-414f-ba6f-c6f455a79ae6 | guest1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
|
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+</computeroutput></screen>
|
|
<para>Backup the database instance by using the trove <command>backup-create</command> command. In this example, the backup is called <literal>backup1</literal>. In this example, you would replace <replaceable>INSTANCE_ID</replaceable> with 97b4b853-80f6-414f-ba6f-c6f455a79ae6:</para>
|
|
<screen><prompt>$</prompt> <userinput>trove backup-create backup1 <replaceable>INSTANCE_ID</replaceable></userinput>
|
|
<computeroutput>+-------------+--------------------------------------+
|
|
| Property | Value |
|
|
+-------------+--------------------------------------+
|
|
| created | 2014-03-18T17:09:07 |
|
|
| description | None |
|
|
| id | 8af30763-61fd-4aab-8fe8-57d528911138 |
|
|
| instance_id | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 |
|
|
| locationRef | None |
|
|
| name | backup1 |
|
|
| parent_id | None |
|
|
| size | None |
|
|
| status | NEW |
|
|
| updated | 2014-03-18T17:09:07 |
|
|
+-------------+--------------------------------------+</computeroutput></screen>
|
|
<para>Note that the command returns both the ID of the original instance (<literal>instance_id</literal>) and the ID of the backup artifact (<literal>id</literal>).</para>
|
|
<para>Later on, you can obtain this same information by using the trove <command>backup-list</command> command:</para>
|
|
<screen><prompt>$</prompt> <userinput>trove backup-list</userinput>
|
|
<computeroutput>+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+
|
|
| id | instance_id | name | status | parent_id | updated |
|
|
+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+
|
|
| 8af30763-61fd-4aab-8fe8-57d528911138 | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 | backup1 | COMPLETED | None | 2014-03-18T17:09:11 |
|
|
+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+</computeroutput></screen>
|
|
<para>You can get additional information about the backup by using the trove <command>backup-show</command> command and passing in the <replaceable>BACKUP_ID</replaceable>, which in this case is 8af30763-61fd-4aab-8fe8-57d528911138.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove backup-show <replaceable>BACKUP_ID</replaceable></userinput>
|
|
<computeroutput>+-------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
|
| Property | Value |
|
|
+-------------+-------------------------------------------------------------------------------------------------------------------------------------+
|
|
| created | 2014-03-18T17:09:07 |
|
|
| description | None |
|
|
| id | 8af30763-61fd-4aab-8fe8-57d528911138 |
|
|
| instance_id | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 |
|
|
| locationRef | http://10.0.0.1:8080/v1/AUTH_626734041baa4254ae316de52a20b390/database_backups/8af30763-61fd-4aab-8fe8-57d528911138.xbstream.gz.enc |
|
|
| name | backup1 |
|
|
| parent_id | None |
|
|
| size | 0.17 |
|
|
| status | COMPLETED |
|
|
| updated | 2014-03-18T17:09:11 |
|
|
+-------------+-------------------------------------------------------------------------------------------------------------------------------------+</computeroutput></screen>
|
|
</step>
|
|
<step>
|
|
<formalpara>
|
|
<title>Restore a database instance.</title>
|
|
<para>Now assume that your <literal>guest1</literal> database instance is damaged and you need to restore it. In this example, you use the trove <command>create</command> command to create a new database instance called <literal>guest2</literal>.</para>
|
|
</formalpara>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>You specify that the new <literal>guest2</literal> instance has the same flavor (<literal>10</literal>) and the same root volume size (<literal>2</literal>) as the original <literal>guest1</literal> instance.</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>You use the <code>--backup</code> argument to indicate that this new instance is based on the backup artifact identified by <replaceable>BACKUP_ID</replaceable>. In this example, you would replace <replaceable>BACKUP_ID</replaceable> with 8af30763-61fd-4aab-8fe8-57d528911138.</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<screen><prompt>$</prompt> <userinput>trove create guest2 10 --size 2 --backup <replaceable>BACKUP_ID</replaceable></userinput>
|
|
<computeroutput>+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| Property | Value |
|
|
+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| created | 2014-03-18T17:12:03 |
|
|
| datastore | {u'version': u'mysql-5.5', u'type': u'mysql'} |
|
|
| datastore_version | mysql-5.5 |
|
|
| flavor | {u'id': u'10', u'links': [{u'href': u'https://10.125.1.135:8779/v1.0/626734041baa4254ae316de52a20b390/flavors/10', u'rel': u'self'}, {u'href': u'https://10.125.1.135:8779/flavors/10', u'rel': u'bookmark'}]} |
|
|
| id | ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b |
|
|
| name | guest2 |
|
|
| status | BUILD |
|
|
| updated | 2014-03-18T17:12:03 |
|
|
| volume | {u'size': 2} |
|
|
+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+</computeroutput></screen>
|
|
</step>
|
|
<step>
|
|
<formalpara>
|
|
<title>Verify backup.</title>
|
|
<para>Now check that the new <literal>guest2</literal> instance has the same characteristics as the original <literal>guest1</literal> instance.</para>
|
|
</formalpara>
|
|
<para>Start by getting the ID of the new <literal>guest2</literal> instance.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove list</userinput>
|
|
<computeroutput>+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
|
| id | name | datastore | datastore_version | status | flavor_id | size |
|
|
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
|
| 97b4b853-80f6-414f-ba6f-c6f455a79ae6 | guest1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
|
| ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b | guest2 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
|
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+</computeroutput></screen>
|
|
<para>Use the trove <command>show</command> command to display information about the new guest2 instance. Pass in guest2's <replaceable>INSTANCE_ID</replaceable>, which in this case is ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove show <replaceable>INSTANCE_ID</replaceable></userinput>
|
|
<computeroutput>+-------------------+--------------------------------------+
|
|
| Property | Value |
|
|
+-------------------+--------------------------------------+
|
|
| created | 2014-03-18T17:12:03 |
|
|
| datastore | mysql |
|
|
| datastore_version | mysql-5.5 |
|
|
| flavor | 10 |
|
|
| id | ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b |
|
|
| ip | 10.0.0.3 |
|
|
| name | guest2 |
|
|
| status | ACTIVE |
|
|
| updated | 2014-03-18T17:12:06 |
|
|
| volume | 2 |
|
|
| volume_used | 0.18 |
|
|
+-------------------+--------------------------------------+</computeroutput></screen>
|
|
<para>Note that the datastore, flavor ID and volume size are the same as the original <literal>guest1</literal> instance.</para>
|
|
<para>Use the trove <command>database-list</command> command to check that the original databases (<literal>db1</literal> and <literal>db2</literal>) are present on the restored instance.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove database-list <replaceable>INSTANCE_ID</replaceable></userinput>
|
|
<computeroutput>+--------------------+
|
|
| name |
|
|
+--------------------+
|
|
| db1 |
|
|
| db2 |
|
|
| performance_schema |
|
|
| test |
|
|
+--------------------+</computeroutput></screen>
|
|
<para>Use the trove <command>user-list</command> command to check that the original user (<literal>user1</literal>) is present on the restored instance.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove user-list <replaceable>INSTANCE_ID</replaceable></userinput>
|
|
<computeroutput>+--------+------+-----------+
|
|
| name | host | databases |
|
|
+--------+------+-----------+
|
|
| user1 | % | db1, db2 |
|
|
+--------+------+-----------+</computeroutput></screen>
|
|
</step>
|
|
<step>
|
|
<formalpara>
|
|
<title>Notify users.</title>
|
|
<para>Tell the users who were accessing the now-disabled <literal>guest1</literal> database instance that they can now access <literal>guest2</literal>. Provide them with <literal>guest2</literal>'s name, IP address, and any other information they might need. (You can get this information by using the trove <command>show</command> command as listed above.)</para>
|
|
</formalpara>
|
|
</step>
|
|
<step>
|
|
<formalpara>
|
|
<title>Clean up.</title>
|
|
<para>At this point, you may also want to delete the disabled <literal>guest1</literal> instance, by using the trove <command>delete</command> command.</para>
|
|
</formalpara>
|
|
<screen><prompt>$</prompt> <userinput>trove delete <replaceable>INSTANCE_ID</replaceable></userinput></screen>
|
|
</step>
|
|
</procedure>
|
|
</section>
|
|
<section xml:id="backup_db_incremental">
|
|
<title>Use incremental backups</title>
|
|
<para>Incremental backups let you chain together a series of backups. You start with a regular backup. Then, when you want to create a subsequent incremental backup, you specify the parent backup.</para>
|
|
<para>Restoring a database instance from an incremental backup is the same as creating a database instance from a regular backup—the Database service handles the complexities of applying the chain of incremental backups.</para>
|
|
<para>This example shows you how to use incremental backups with a MySQL database.</para>
|
|
<formalpara>
|
|
<title>Assumptions.</title>
|
|
<para>Assume that you have <link linkend="backup_db">created a regular backup</link> for the following database instance:</para>
|
|
</formalpara>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>Instance name: <literal>guest1</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>ID of the instance (<replaceable>INSTANCE_ID</replaceable>): <literal>792a6a56-278f-4a01-9997-d997fa126370</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>ID of the regular backup artifact (<replaceable>BACKUP_ID</replaceable>): <literal>6dc3a9b7-1f3e-4954-8582-3f2e4942cddd</literal></para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<procedure>
|
|
<title>To create and use incremental backups</title>
|
|
<step>
|
|
<formalpara>
|
|
<title>Create your first incremental backup.</title>
|
|
<para>Use the trove <command>backup-create</command> command and specify:</para>
|
|
</formalpara>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>The name of the incremental backup you are creating: <literal>backup1.1</literal></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>The <replaceable>INSTANCE_ID</replaceable> of the database instance you are doing the incremental backup for (in this example, <literal>792a6a56-278f-4a01-9997-d997fa126370</literal>)</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>The <replaceable>BACKUP_ID</replaceable> of the parent backup. In this case, the parent is the regular backup, with an ID of <literal>6dc3a9b7-1f3e-4954-8582-3f2e4942cddd</literal></para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<screen><prompt>$</prompt> <userinput>trove backup-create backup1.1 <replaceable>INSTANCE_ID</replaceable> --parent <replaceable>BACKUP_ID</replaceable></userinput>
|
|
<computeroutput>+-------------+--------------------------------------+
|
|
| Property | Value |
|
|
+-------------+--------------------------------------+
|
|
| created | 2014-03-19T14:09:13 |
|
|
| description | None |
|
|
| id | 1d474981-a006-4f62-b25f-43d7b8a7097e |
|
|
| instance_id | 792a6a56-278f-4a01-9997-d997fa126370 |
|
|
| locationRef | None |
|
|
| name | backup1.1 |
|
|
| parent_id | 6dc3a9b7-1f3e-4954-8582-3f2e4942cddd |
|
|
| size | None |
|
|
| status | NEW |
|
|
| updated | 2014-03-19T14:09:13 |
|
|
+-------------+--------------------------------------+</computeroutput></screen>
|
|
<para>Note that this command returns both the ID of the database instance you are incrementally backing up (<literal>instance_id</literal>) and a new ID for the new incremental backup artifact you just created (<literal>id</literal>).</para>
|
|
</step>
|
|
<step>
|
|
<formalpara>
|
|
<title>Create your second incremental backup.</title>
|
|
<para>The name of your second incremental backup is <literal>backup1.2</literal>. This time, when you specify the parent, pass in the ID of the incremental backup you just created in the previous step (<literal>backup1.1</literal>). In this example, it would be <literal>1d474981-a006-4f62-b25f-43d7b8a7097e</literal>.</para>
|
|
</formalpara>
|
|
<screen><prompt>$</prompt> <userinput>trove backup-create backup1.2 <replaceable>INSTANCE_ID</replaceable> --parent <replaceable>BACKUP_ID</replaceable></userinput>
|
|
<computeroutput>+-------------+--------------------------------------+
|
|
| Property | Value |
|
|
+-------------+--------------------------------------+
|
|
| created | 2014-03-19T14:09:13 |
|
|
| description | None |
|
|
| id | bb84a240-668e-49b5-861e-6a98b67e7a1f |
|
|
| instance_id | 792a6a56-278f-4a01-9997-d997fa126370 |
|
|
| locationRef | None |
|
|
| name | backup1.2 |
|
|
| parent_id | 1d474981-a006-4f62-b25f-43d7b8a7097e |
|
|
| size | None |
|
|
| status | NEW |
|
|
| updated | 2014-03-19T14:09:13 |
|
|
+-------------+--------------------------------------+</computeroutput></screen>
|
|
</step>
|
|
<step>
|
|
<formalpara>
|
|
<title>Restore using incremental backups.</title>
|
|
<para>Now assume that your <literal>guest1</literal> database instance is damaged and you need to restore it from your incremental backups. In this example, you use the trove <command>create</command> command to create a new database instance called <literal>guest2</literal>.</para>
|
|
</formalpara>
|
|
<para>To incorporate your incremental backups, you simply use the <code>--backup</code> argument to pass in the <replaceable>BACKUP_ID</replaceable> of your most recent incremental backup. The Database service handles the complexities of applying the chain of all previous incremental backups.</para>
|
|
<screen><prompt>$</prompt> <userinput>trove create guest2 10 --size 1 --backup <replaceable>BACKUP_ID</replaceable></userinput>
|
|
<computeroutput>+-------------------+-----------------------------------------------------------+
|
|
| Property | Value |
|
|
+-------------------+-----------------------------------------------------------+
|
|
| created | 2014-03-19T14:10:56 |
|
|
| datastore | {u'version': u'mysql-5.5', u'type': u'mysql'} |
|
|
| datastore_version | mysql-5.5 |
|
|
| flavor | {u'id': u'10', u'links': |
|
|
| | [{u'href': u'https://10.125.1.135:8779/v1.0/ |
|
|
| | 626734041baa4254ae316de52a20b390/flavors/10', u'rel': |
|
|
| | u'self'}, {u'href': u'https://10.125.1.135:8779/ |
|
|
| | flavors/10', u'rel': u'bookmark'}]} |
|
|
| id | a3680953-eea9-4cf2-918b-5b8e49d7e1b3 |
|
|
| name | guest2 |
|
|
| status | BUILD |
|
|
| updated | 2014-03-19T14:10:56 |
|
|
| volume | {u'size': 1} |
|
|
+-------------------+-----------------------------------------------------------+</computeroutput></screen>
|
|
</step>
|
|
</procedure>
|
|
</section>
|
|
</section>
|