[user-guide] Fix rst markups for user guide files
Implements: blueprint user-guides-reorganised Change-Id: I2858722ee55ecb705b4e62c4cc763b4f747490c4
This commit is contained in:
parent
96d208e736
commit
ca5a3104f1
@ -26,112 +26,118 @@ This example shows you how to back up and restore a MySQL database.
|
||||
- Users: The ``user1`` user with the ``password`` password
|
||||
|
||||
First, get the ID of the ``guest1`` database instance by using the
|
||||
trove ``list`` command:
|
||||
:command:`trove list` command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove list
|
||||
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| 97b4b853-80f6-414f-ba6f-c6f455a79ae6 | guest1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
||||
$ trove list
|
||||
|
||||
Back up the database instance by using the trove ``backup-create``
|
||||
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| 97b4b853-80f6-414f-ba6f-c6f455a79ae6 | guest1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
+--------------------------------------+--------+-----------+-------------------+--------+-----------+------+
|
||||
|
||||
Back up the database instance by using the :command:`trove backup-create`
|
||||
command. In this example, the backup is called ``backup1``. In this
|
||||
example, replace ``INSTANCE_ID`` with
|
||||
``97b4b853-80f6-414f-ba6f-c6f455a79ae6``:
|
||||
|
||||
.. note:: This command syntax pertains only to python-troveclient version
|
||||
.. note::
|
||||
|
||||
This command syntax pertains only to python-troveclient version
|
||||
1.0.6 and later. Earlier versions require you to pass in the backup
|
||||
name as the first argument.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove backup-create INSTANCE_ID backup1
|
||||
+-------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------+--------------------------------------+
|
||||
$ trove backup-create INSTANCE_ID backup1
|
||||
|
||||
+-------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------+--------------------------------------+
|
||||
|
||||
Note that the command returns both the ID of the original instance
|
||||
(``instance_id``) and the ID of the backup artifact (``id``).
|
||||
|
||||
Later on, use the trove ``backup-list`` command to get this
|
||||
Later on, use the :command:`trove backup-list` command to get this
|
||||
information:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove backup-list
|
||||
+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+
|
||||
| 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 |
|
||||
+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+
|
||||
$ trove backup-list
|
||||
+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+
|
||||
| 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 |
|
||||
+--------------------------------------+--------------------------------------+---------+-----------+-----------+---------------------+
|
||||
|
||||
You can get additional information about the backup by using the
|
||||
trove ``backup-show`` command and passing in the ``BACKUP_ID``,
|
||||
:command:`trove backup-show` command and passing in the ``BACKUP_ID``,
|
||||
which is ``8af30763-61fd-4aab-8fe8-57d528911138``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove backup-show BACKUP_ID
|
||||
+-------------+----------------------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------+----------------------------------------------------+
|
||||
| created | 2014-03-18T17:09:07 |
|
||||
| description | None |
|
||||
| id | 8af...138 |
|
||||
| instance_id | 97b...ae6 |
|
||||
| locationRef | http://10.0.0.1:.../.../8af...138.xbstream.gz.enc |
|
||||
| name | backup1 |
|
||||
| parent_id | None |
|
||||
| size | 0.17 |
|
||||
| status | COMPLETED |
|
||||
| updated | 2014-03-18T17:09:11 |
|
||||
+-------------+----------------------------------------------------+
|
||||
$ trove backup-show BACKUP_ID
|
||||
|
||||
+-------------+----------------------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------+----------------------------------------------------+
|
||||
| created | 2014-03-18T17:09:07 |
|
||||
| description | None |
|
||||
| id | 8af...138 |
|
||||
| instance_id | 97b...ae6 |
|
||||
| locationRef | http://10.0.0.1:.../.../8af...138.xbstream.gz.enc |
|
||||
| name | backup1 |
|
||||
| parent_id | None |
|
||||
| size | 0.17 |
|
||||
| status | COMPLETED |
|
||||
| updated | 2014-03-18T17:09:11 |
|
||||
+-------------+----------------------------------------------------+
|
||||
|
||||
#. **Restore a database instance**
|
||||
|
||||
Now assume that your ``guest1`` database instance is damaged and you
|
||||
need to restore it. In this example, you use the trove ``create``
|
||||
need to restore it. In this example, you use the :command:`trove create`
|
||||
command to create a new database instance called ``guest2``.
|
||||
|
||||
- You specify that the new ``guest2`` instance has the same flavor
|
||||
(``10``) and the same root volume size (``2``) as the original
|
||||
``guest1`` instance.
|
||||
|
||||
- You use the ``--backup`` argument to indicate that this new
|
||||
- You use the :option:`--backup` argument to indicate that this new
|
||||
instance is based on the backup artifact identified by
|
||||
``BACKUP_ID``. In this example, replace ``BACKUP_ID`` with
|
||||
``8af30763-61fd-4aab-8fe8-57d528911138``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove create guest2 10 --size 2 --backup BACKUP_ID
|
||||
+-------------------+----------------------------------------------+
|
||||
| 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': ...]} |
|
||||
| id | ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b |
|
||||
| name | guest2 |
|
||||
| status | BUILD |
|
||||
| updated | 2014-03-18T17:12:03 |
|
||||
| volume | {u'size': 2} |
|
||||
+-------------------+----------------------------------------------+
|
||||
$ trove create guest2 10 --size 2 --backup BACKUP_ID
|
||||
|
||||
+-------------------+----------------------------------------------+
|
||||
| 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': ...]} |
|
||||
| id | ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b |
|
||||
| name | guest2 |
|
||||
| status | BUILD |
|
||||
| updated | 2014-03-18T17:12:03 |
|
||||
| volume | {u'size': 2} |
|
||||
+-------------------+----------------------------------------------+
|
||||
|
||||
#. **Verify backup**
|
||||
|
||||
@ -140,83 +146,87 @@ This example shows you how to back up and restore a MySQL database.
|
||||
|
||||
Start by getting the ID of the new ``guest2`` instance.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove list
|
||||
+-----------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+-----------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| 97b...ae6 | guest1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
| ac7...04b | guest2 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
+-----------+--------+-----------+-------------------+--------+-----------+------+
|
||||
$ trove list
|
||||
|
||||
Use the trove ``show`` command to display information about the new
|
||||
+-----------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+-----------+--------+-----------+-------------------+--------+-----------+------+
|
||||
| 97b...ae6 | guest1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
| ac7...04b | guest2 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
+-----------+--------+-----------+-------------------+--------+-----------+------+
|
||||
|
||||
Use the :command:`trove show` command to display information about the new
|
||||
guest2 instance. Pass in guest2's ``INSTANCE_ID``, which is
|
||||
``ac7a2b35-a9b4-4ff6-beac-a1bcee86d04b``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove show INSTANCE_ID
|
||||
+-------------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------------+--------------------------------------+
|
||||
$ trove show INSTANCE_ID
|
||||
|
||||
+-------------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------------+--------------------------------------+
|
||||
|
||||
Note that the data store, flavor ID, and volume size have the same
|
||||
values as in the original ``guest1`` instance.
|
||||
|
||||
Use the trove ``database-list`` command to check that the original
|
||||
Use the :command:`trove database-list` command to check that the original
|
||||
databases (``db1`` and ``db2``) are present on the restored instance.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove database-list INSTANCE_ID
|
||||
+--------------------+
|
||||
| name |
|
||||
+--------------------+
|
||||
| db1 |
|
||||
| db2 |
|
||||
| performance_schema |
|
||||
| test |
|
||||
+--------------------+
|
||||
$ trove database-li0st INSTANCE_ID
|
||||
|
||||
Use the trove ``user-list`` command to check that the original user
|
||||
+--------------------+
|
||||
| name |
|
||||
+--------------------+
|
||||
| db1 |
|
||||
| db2 |
|
||||
| performance_schema |
|
||||
| test |
|
||||
+--------------------+
|
||||
|
||||
Use the :command:`trove user-list` command to check that the original user
|
||||
(``user1``) is present on the restored instance.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove user-list INSTANCE_ID
|
||||
+--------+------+-----------+
|
||||
| name | host | databases |
|
||||
+--------+------+-----------+
|
||||
| user1 | % | db1, db2 |
|
||||
+--------+------+-----------+
|
||||
$ trove user-list INSTANCE_ID
|
||||
|
||||
+--------+------+-----------+
|
||||
| name | host | databases |
|
||||
+--------+------+-----------+
|
||||
| user1 | % | db1, db2 |
|
||||
+--------+------+-----------+
|
||||
|
||||
#. **Notify users**
|
||||
|
||||
Tell the users who were accessing the now-disabled ``guest1``
|
||||
database instance that they can now access ``guest2``. Provide them
|
||||
with ``guest2``'s name, IP address, and any other information they
|
||||
might need. (You can get this information by using the trove ``show``
|
||||
command.)
|
||||
might need. (You can get this information by using the
|
||||
:command:`trove show` command.)
|
||||
|
||||
#. **Clean up**
|
||||
|
||||
At this point, you might want to delete the disabled ``guest1``
|
||||
instance, by using the trove ``delete`` command.
|
||||
instance, by using the :command:`trove delete` command.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove delete INSTANCE_ID
|
||||
$ trove delete INSTANCE_ID
|
||||
|
||||
|
@ -29,7 +29,7 @@ Create and use incremental backups
|
||||
|
||||
#. **Create your first incremental backup**
|
||||
|
||||
Use the trove ``backup-create`` command and specify:
|
||||
Use the :command:`trove backup-create` command and specify:
|
||||
|
||||
- The ``INSTANCE_ID`` of the database instance you are doing the
|
||||
incremental backup for (in this example,
|
||||
@ -41,23 +41,24 @@ Create and use incremental backups
|
||||
is the regular backup, with an ID of
|
||||
``6dc3a9b7-1f3e-4954-8582-3f2e4942cddd``
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove backup-create INSTANCE_ID backup1.1 --parent BACKUP_ID
|
||||
+-------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------+--------------------------------------+
|
||||
$ trove backup-create INSTANCE_ID backup1.1 --parent BACKUP_ID
|
||||
|
||||
+-------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------+--------------------------------------+
|
||||
|
||||
Note that this command returns both the ID of the database instance
|
||||
you are incrementally backing up (``instance_id``) and a new ID for
|
||||
@ -70,55 +71,57 @@ Create and use incremental backups
|
||||
backup you just created in the previous step (``backup1.1``). In this
|
||||
example, it is ``1d474981-a006-4f62-b25f-43d7b8a7097e``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove backup-create INSTANCE_ID backup1.2 --parent BACKUP_ID
|
||||
+-------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------+--------------------------------------+
|
||||
$ trove backup-create INSTANCE_ID backup1.2 --parent BACKUP_ID
|
||||
|
||||
+-------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------+--------------------------------------+
|
||||
|
||||
#. **Restore using incremental backups**
|
||||
|
||||
Now assume that your ``guest1`` database instance is damaged and you
|
||||
need to restore it from your incremental backups. In this example,
|
||||
you use the trove ``create`` command to create a new database
|
||||
you use the :command:`trove create` command to create a new database
|
||||
instance called ``guest2``.
|
||||
|
||||
To incorporate your incremental backups, you simply use the
|
||||
``--backup`` parameter to pass in the ``BACKUP_ID`` of your most
|
||||
:option:`--backup` parameter to pass in the ``BACKUP_ID`` of your most
|
||||
recent incremental backup. The Database service handles the
|
||||
complexities of applying the chain of all previous incremental
|
||||
backups.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove create guest2 10 --size 1 --backup BACKUP_ID
|
||||
+-------------------+-----------------------------------------------------------+
|
||||
| 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} |
|
||||
+-------------------+-----------------------------------------------------------+
|
||||
$ trove create guest2 10 --size 1 --backup BACKUP_ID
|
||||
|
||||
+-------------------+-----------------------------------------------------------+
|
||||
| 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} |
|
||||
+-------------------+-----------------------------------------------------------+
|
||||
|
||||
|
@ -65,62 +65,75 @@ stack and the :command:`ceilometer` client to measure resources.
|
||||
#. Create an auto-scaling stack by running the following command.
|
||||
The :option:`-f` option specifies the name of the stack template
|
||||
file, and the :option:`-P` option specifies the ``KeyName``
|
||||
parameter as ``heat_key``::
|
||||
parameter as ``heat_key``:
|
||||
|
||||
$ heat stack-create -f cfn/F17/AutoScalingCeilometer.yaml -P "KeyName=heat_key"
|
||||
.. code-block:: console
|
||||
|
||||
#. List the heat resources that were created::
|
||||
$ heat stack-create -f cfn/F17/AutoScalingCeilometer.yaml -P "KeyName=heat_key"
|
||||
|
||||
$ heat resource-list
|
||||
+--------------------------+-----------------------------------------+----------------+----------------------+
|
||||
| resource_name | resource_type |resource_status | updated_time |
|
||||
+--------------------------+-----------------------------------------+----------------+----------------------+
|
||||
| CfnUser | AWS::IAM::User |CREATE_COMPLETE | 2013-10-02T05:53:41Z |
|
||||
| WebServerKeys | AWS::IAM::AccessKey |CREATE_COMPLETE | 2013-10-02T05:53:42Z |
|
||||
| LaunchConfig | AWS::AutoScaling::LaunchConfiguration |CREATE_COMPLETE | 2013-10-02T05:53:43Z |
|
||||
| ElasticLoadBalancer | AWS::ElasticLoadBalancing::LoadBalancer |UPDATE_COMPLETE | 2013-10-02T05:55:58Z |
|
||||
| WebServerGroup | AWS::AutoScaling::AutoScalingGroup |CREATE_COMPLETE | 2013-10-02T05:55:58Z |
|
||||
| WebServerScaleDownPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
|
||||
| WebServerScaleUpPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
|
||||
| CPUAlarmHigh | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
|
||||
| CPUAlarmLow | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
|
||||
+--------------------------+-----------------------------------------+-----------------+---------------------+
|
||||
#. List the heat resources that were created:
|
||||
|
||||
#. List the alarms that are set::
|
||||
.. code-block:: console
|
||||
|
||||
$ ceilometer alarm-list
|
||||
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
|
||||
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition |
|
||||
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
|
||||
| 4f896b40-0859-460b-9c6a-b0d329814496 | as-CPUAlarmLow-i6qqgkf2fubs | insufficient data | True | False | cpu_util < 15.0 during 1x 60s |
|
||||
| 75d8ecf7-afc5-4bdc-95ff-19ed9ba22920 | as-CPUAlarmHigh-sf4muyfruy5m | insufficient data | True | False | cpu_util > 50.0 during 1x 60s |
|
||||
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
|
||||
$ heat resource-list
|
||||
|
||||
#. List the meters that are set::
|
||||
+--------------------------+-----------------------------------------+----------------+----------------------+
|
||||
| resource_name | resource_type |resource_status | updated_time |
|
||||
+--------------------------+-----------------------------------------+----------------+----------------------+
|
||||
| CfnUser | AWS::IAM::User |CREATE_COMPLETE | 2013-10-02T05:53:41Z |
|
||||
| WebServerKeys | AWS::IAM::AccessKey |CREATE_COMPLETE | 2013-10-02T05:53:42Z |
|
||||
| LaunchConfig | AWS::AutoScaling::LaunchConfiguration |CREATE_COMPLETE | 2013-10-02T05:53:43Z |
|
||||
| ElasticLoadBalancer | AWS::ElasticLoadBalancing::LoadBalancer |UPDATE_COMPLETE | 2013-10-02T05:55:58Z |
|
||||
| WebServerGroup | AWS::AutoScaling::AutoScalingGroup |CREATE_COMPLETE | 2013-10-02T05:55:58Z |
|
||||
| WebServerScaleDownPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
|
||||
| WebServerScaleUpPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
|
||||
| CPUAlarmHigh | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
|
||||
| CPUAlarmLow | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
|
||||
+--------------------------+-----------------------------------------+-----------------+---------------------+
|
||||
|
||||
$ ceilometer meter-list
|
||||
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
|
||||
| Name | Type | Unit | Resource ID | User ID | Project ID |
|
||||
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
|
||||
| cpu | cumulative | ns | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
|
||||
| cpu | cumulative | ns | 62520a83-73c7-4084-be54-275fe770ef2c | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
|
||||
| cpu_util | gauge | % | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
|
||||
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
|
||||
#. List the alarms that are set:
|
||||
|
||||
#. List samples::
|
||||
.. code-block:: console
|
||||
|
||||
$ ceilometer sample-list -m cpu_util
|
||||
+--------------------------------------+----------+-------+---------------+------+---------------------+
|
||||
| Resource ID | Name | Type | Volume | Unit | Timestamp |
|
||||
+--------------------------------------+----------+-------+---------------+------+---------------------+
|
||||
| 3965b41b-81b0-4386-bea5-6ec37c8841c1 | cpu_util | gauge | 3.98333333333 | % | 2013-10-02T10:50:12 |
|
||||
+--------------------------------------+----------+-------+---------------+------+---------------------+
|
||||
$ ceilometer alarm-list
|
||||
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
|
||||
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition |
|
||||
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
|
||||
| 4f896b40-0859-460b-9c6a-b0d329814496 | as-CPUAlarmLow-i6qqgkf2fubs | insufficient data | True | False | cpu_util < 15.0 during 1x 60s |
|
||||
| 75d8ecf7-afc5-4bdc-95ff-19ed9ba22920 | as-CPUAlarmHigh-sf4muyfruy5m | insufficient data | True | False | cpu_util > 50.0 during 1x 60s |
|
||||
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
|
||||
|
||||
#. View statistics::
|
||||
#. List the meters that are set:
|
||||
|
||||
$ ceilometer statistics -m cpu_util
|
||||
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
|
||||
| Period | Period Start | Period End | Count | Min | Max | Sum | Avg | Duration | Duration Start | Duration End |
|
||||
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
|
||||
| 0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 | 1 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 0.0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 |
|
||||
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
|
||||
.. code-block:: console
|
||||
|
||||
$ ceilometer meter-list
|
||||
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
|
||||
| Name | Type | Unit | Resource ID | User ID | Project ID |
|
||||
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
|
||||
| cpu | cumulative | ns | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
|
||||
| cpu | cumulative | ns | 62520a83-73c7-4084-be54-275fe770ef2c | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
|
||||
| cpu_util | gauge | % | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
|
||||
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
|
||||
|
||||
#. List samples:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ ceilometer sample-list -m cpu_util
|
||||
+--------------------------------------+----------+-------+---------------+------+---------------------+
|
||||
| Resource ID | Name | Type | Volume | Unit | Timestamp |
|
||||
+--------------------------------------+----------+-------+---------------+------+---------------------+
|
||||
| 3965b41b-81b0-4386-bea5-6ec37c8841c1 | cpu_util | gauge | 3.98333333333 | % | 2013-10-02T10:50:12 |
|
||||
+--------------------------------------+----------+-------+---------------+------+---------------------+
|
||||
|
||||
#. View statistics:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ ceilometer statistics -m cpu_util
|
||||
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
|
||||
| Period | Period Start | Period End | Count | Min | Max | Sum | Avg | Duration | Duration Start | Duration End |
|
||||
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
|
||||
| 0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 | 1 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 0.0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 |
|
||||
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
|
||||
|
@ -9,219 +9,221 @@ Identity (keystone)
|
||||
|
||||
List all users
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ keystone user-list
|
||||
$ keystone user-list
|
||||
|
||||
List Identity service catalog
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ keystone catalog
|
||||
$ keystone catalog
|
||||
|
||||
Images (glance)
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
List images you can access
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-list
|
||||
$ glance image-list
|
||||
|
||||
Delete specified image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-delete IMAGE
|
||||
$ glance image-delete IMAGE
|
||||
|
||||
Describe a specific image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-show IMAGE
|
||||
$ glance image-show IMAGE
|
||||
|
||||
Update image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-update IMAGE
|
||||
$ glance image-update IMAGE
|
||||
|
||||
Upload kernel image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-create --name "cirros-threepart-kernel" \
|
||||
--disk-format aki --container-format aki --is-public False \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-vmlinuz
|
||||
$ glance image-create --name "cirros-threepart-kernel" \
|
||||
--disk-format aki --container-format aki --is-public False \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-vmlinuz
|
||||
|
||||
Upload RAM image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-create --name "cirros-threepart-ramdisk" \
|
||||
--disk-format ari --container-format ari --is-public False \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-initrd
|
||||
$ glance image-create --name "cirros-threepart-ramdisk" \
|
||||
--disk-format ari --container-format ari --is-public False \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-initrd
|
||||
|
||||
Upload three-part image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-create --name "cirros-threepart" --disk-format ami \
|
||||
--container-format ami --is-public False \
|
||||
--property kernel_id=$KID-property ramdisk_id=$RID \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-blank.img
|
||||
$ glance image-create --name "cirros-threepart" --disk-format ami \
|
||||
--container-format ami --is-public False \
|
||||
--property kernel_id=$KID-property ramdisk_id=$RID \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-blank.img
|
||||
|
||||
Register raw image
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ glance image-create --name "cirros-qcow2" --disk-format qcow2 \
|
||||
--container-format bare --is-public False \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-disk.img
|
||||
$ glance image-create --name "cirros-qcow2" --disk-format qcow2 \
|
||||
--container-format bare --is-public False \
|
||||
--file ~/images/cirros-0.3.1~pre4-x86_64-disk.img
|
||||
|
||||
Compute (nova)
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
List instances, check status of instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova list
|
||||
$ nova list
|
||||
|
||||
List images
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova image-list
|
||||
$ nova image-list
|
||||
|
||||
List flavors
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova flavor-list
|
||||
$ nova flavor-list
|
||||
|
||||
Boot an instance using flavor and image names (if names are unique)
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova boot --image IMAGE --flavor FLAVOR INSTANCE_NAME
|
||||
$ nova boot --image cirros-0.3.1-x86_64-uec --flavor m1.tiny \
|
||||
MyFirstInstance
|
||||
$ nova boot --image IMAGE --flavor FLAVOR INSTANCE_NAME
|
||||
$ nova boot --image cirros-0.3.1-x86_64-uec --flavor m1.tiny \
|
||||
MyFirstInstance
|
||||
|
||||
Login to instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# ip netns
|
||||
# ip netns exec NETNS_NAME ssh USER@SERVER
|
||||
# ip netns exec qdhcp-6021a3b4-8587-4f9c-8064-0103885dfba2 \
|
||||
ssh cirros@10.0.0.2
|
||||
# ip netns
|
||||
# ip netns exec NETNS_NAME ssh USER@SERVER
|
||||
# ip netns exec qdhcp-6021a3b4-8587-4f9c-8064-0103885dfba2 \
|
||||
ssh cirros@10.0.0.2
|
||||
|
||||
.. note:: In CirrOS the password for user ``cirros`` is "cubswin:)" without
|
||||
.. note::
|
||||
|
||||
In CirrOS the password for user ``cirros`` is "cubswin:)" without
|
||||
the quotes.
|
||||
|
||||
Show details of instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova show NAME
|
||||
$ nova show MyFirstInstance
|
||||
$ nova show NAME
|
||||
$ nova show MyFirstInstance
|
||||
|
||||
View console log of instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova console-log MyFirstInstance
|
||||
$ nova console-log MyFirstInstance
|
||||
|
||||
Set metadata on an instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova meta volumeTwoImage set newmeta='my meta data'
|
||||
$ nova meta volumeTwoImage set newmeta='my meta data'
|
||||
|
||||
Create an instance snapshot
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova image-create volumeTwoImage snapshotOfVolumeImage
|
||||
$ nova image-show snapshotOfVolumeImage
|
||||
$ nova image-create volumeTwoImage snapshotOfVolumeImage
|
||||
$ nova image-show snapshotOfVolumeImage
|
||||
|
||||
Pause, suspend, stop, rescue, resize, rebuild, reboot an instance
|
||||
-----------------------------------------------------------------
|
||||
|
||||
Pause
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova pause NAME
|
||||
$ nova pause volumeTwoImage
|
||||
$ nova pause NAME
|
||||
$ nova pause volumeTwoImage
|
||||
|
||||
Unpause
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova unpause NAME
|
||||
$ nova unpause NAME
|
||||
|
||||
Suspend
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova suspend NAME
|
||||
$ nova suspend NAME
|
||||
|
||||
Unsuspend
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova resume NAME
|
||||
$ nova resume NAME
|
||||
|
||||
Stop
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova stop NAME
|
||||
$ nova stop NAME
|
||||
|
||||
Start
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova start NAME
|
||||
$ nova start NAME
|
||||
|
||||
Rescue
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova rescue NAME
|
||||
$ nova rescue NAME --rescue_image_ref RESCUE_IMAGE
|
||||
$ nova rescue NAME
|
||||
$ nova rescue NAME --rescue_image_ref RESCUE_IMAGE
|
||||
|
||||
Resize
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova resize NAME FLAVOR
|
||||
$ nova resize my-pem-server m1.small
|
||||
$ nova resize-confirm my-pem-server1
|
||||
$ nova resize NAME FLAVOR
|
||||
$ nova resize my-pem-server m1.small
|
||||
$ nova resize-confirm my-pem-server1
|
||||
|
||||
Rebuild
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova rebuild NAME IMAGE
|
||||
$ nova rebuild newtinny cirros-qcow2
|
||||
$ nova rebuild NAME IMAGE
|
||||
$ nova rebuild newtinny cirros-qcow2
|
||||
|
||||
Reboot
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova reboot NAME
|
||||
$ nova reboot newtinny
|
||||
$ nova reboot NAME
|
||||
$ nova reboot newtinny
|
||||
|
||||
Inject user data and files into an instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova boot --user-data FILE INSTANCE
|
||||
$ nova boot --user-data userdata.txt --image cirros-qcow2 \
|
||||
--flavor m1.tiny MyUserdataInstance2
|
||||
$ nova boot --user-data FILE INSTANCE
|
||||
$ nova boot --user-data userdata.txt --image cirros-qcow2 \
|
||||
--flavor m1.tiny MyUserdataInstance2
|
||||
|
||||
To validate that the file was injected, use ssh to connect to the instance,
|
||||
and look in ``/var/lib/cloud`` for the file.
|
||||
@ -231,50 +233,50 @@ keypair
|
||||
|
||||
Create keypair
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova keypair-add test > test.pem
|
||||
$ chmod 600 test.pem
|
||||
$ nova keypair-add test > test.pem
|
||||
$ chmod 600 test.pem
|
||||
|
||||
Start an instance (boot)
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova boot --image cirros-0.3.0-x86_64 --flavor m1.small \
|
||||
--key_name test MyFirstServer
|
||||
$ nova boot --image cirros-0.3.0-x86_64 --flavor m1.small \
|
||||
--key_name test MyFirstServer
|
||||
|
||||
Use ssh to connect to the instance
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# ip netns exec qdhcp-98f09f1e-64c4-4301-a897-5067ee6d544f \
|
||||
ssh -i test.pem cirros@10.0.0.4
|
||||
# ip netns exec qdhcp-98f09f1e-64c4-4301-a897-5067ee6d544f \
|
||||
ssh -i test.pem cirros@10.0.0.4
|
||||
|
||||
Manage security groups
|
||||
|
||||
Add rules to default security group allowing ping and SSH between
|
||||
instances in the default security group
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova secgroup-add-group-rule default default icmp -1 -1
|
||||
$ nova secgroup-add-group-rule default default tcp 22 22
|
||||
$ nova secgroup-add-group-rule default default icmp -1 -1
|
||||
$ nova secgroup-add-group-rule default default tcp 22 22
|
||||
|
||||
Networking (neutron)
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Create network
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ neutron net-create NAME
|
||||
$ neutron net-create NAME
|
||||
|
||||
Create a subnet
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ neutron subnet-create NETWORK_NAME CIDR
|
||||
$ neutron subnet-create my-network 10.0.0.0/29
|
||||
$ neutron subnet-create NETWORK_NAME CIDR
|
||||
$ neutron subnet-create my-network 10.0.0.0/29
|
||||
|
||||
Block Storage (cinder)
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -283,85 +285,85 @@ Used to manage volumes and volume snapshots that attach to instances.
|
||||
|
||||
Create a new volume
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ cinder create SIZE_IN_GB --display-name NAME
|
||||
$ cinder create 1 --display-name MyFirstVolume
|
||||
$ cinder create SIZE_IN_GB --display-name NAME
|
||||
$ cinder create 1 --display-name MyFirstVolume
|
||||
|
||||
Boot an instance and attach to volume
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova boot --image cirros-qcow2 --flavor m1.tiny MyVolumeInstance
|
||||
$ nova boot --image cirros-qcow2 --flavor m1.tiny MyVolumeInstance
|
||||
|
||||
List volumes, notice status of volume
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ cinder list
|
||||
$ cinder list
|
||||
|
||||
Attach volume to instance after instance is active, and volume is
|
||||
available
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ nova volume-attach INSTANCE_ID VOLUME_ID auto
|
||||
$ nova volume-attach MyVolumeInstance /dev/vdb auto
|
||||
$ nova volume-attach INSTANCE_ID VOLUME_ID auto
|
||||
$ nova volume-attach MyVolumeInstance /dev/vdb auto
|
||||
|
||||
Manage volumes after login into the instance
|
||||
|
||||
List storage devices
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# fdisk -l
|
||||
# fdisk -l
|
||||
|
||||
Make filesystem on volume
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# mkfs.ext3 /dev/vdb
|
||||
# mkfs.ext3 /dev/vdb
|
||||
|
||||
Create a mountpoint
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# mkdir /myspace
|
||||
# mkdir /myspace
|
||||
|
||||
Mount the volume at the mountpoint
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# mount /dev/vdb /myspace
|
||||
# mount /dev/vdb /myspace
|
||||
|
||||
Create a file on the volume
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# touch /myspace/helloworld.txt
|
||||
# ls /myspace
|
||||
# touch /myspace/helloworld.txt
|
||||
# ls /myspace
|
||||
|
||||
Unmount the volume
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
# umount /myspace
|
||||
# umount /myspace
|
||||
|
||||
Object Storage (swift)
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Display information for the account, container, or object
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ swift stat
|
||||
$ swift stat ACCOUNT
|
||||
$ swift stat CONTAINER
|
||||
$ swift stat OBJECT
|
||||
$ swift stat
|
||||
$ swift stat ACCOUNT
|
||||
$ swift stat CONTAINER
|
||||
$ swift stat OBJECT
|
||||
|
||||
List containers
|
||||
|
||||
.. code:: console
|
||||
.. code-block:: console
|
||||
|
||||
$ swift list
|
||||
$ swift list
|
||||
|
||||
|
@ -25,23 +25,27 @@ Create a stack from an example template file
|
||||
|
||||
- To create a stack, or template, from an `example template
|
||||
file <https://git.openstack.org/cgit/openstack/heat-templates>`__, run
|
||||
the following command::
|
||||
the following command:
|
||||
|
||||
$ heat stack-create mystack --template-file /PATH_TO_HEAT_TEMPLATES/WordPress_Single_Instance.template \
|
||||
--parameters "InstanceType=m1.large;DBUsername=USERNAME;DBPassword=PASSWORD;KeyName=HEAT_KEY;LinuxDistribution=F17"
|
||||
.. code-block:: console
|
||||
|
||||
$ heat stack-create mystack --template-file /PATH_TO_HEAT_TEMPLATES/WordPress_Single_Instance.template \
|
||||
--parameters "InstanceType=m1.large;DBUsername=USERNAME;DBPassword=PASSWORD;KeyName=HEAT_KEY;LinuxDistribution=F17"
|
||||
|
||||
The :option:`--parameters` values that you specify depend on the parameters
|
||||
that are defined in the template. If a website hosts the template
|
||||
file, you can specify the URL with the :option:`--template-url` parameter
|
||||
instead of the :option:`--template-file` parameter.
|
||||
|
||||
The command returns the following output::
|
||||
The command returns the following output:
|
||||
|
||||
+------------------+---------------+--------------------+----------------------+
|
||||
| id | stack_name | stack_status | creation_time |
|
||||
+------------------+---------------+--------------------+----------------------+
|
||||
| 4c712026-dcd5... | mystack | CREATE_IN_PROGRESS | 2013-04-03T23:22:08Z |
|
||||
+------------------+---------------+--------------------+----------------------+
|
||||
.. code-block:: console
|
||||
|
||||
+------------------+---------------+--------------------+----------------------+
|
||||
| id | stack_name | stack_status | creation_time |
|
||||
+------------------+---------------+--------------------+----------------------+
|
||||
| 4c712026-dcd5... | mystack | CREATE_IN_PROGRESS | 2013-04-03T23:22:08Z |
|
||||
+------------------+---------------+--------------------+----------------------+
|
||||
|
||||
- You can also use the :command:`template-validate` command to validate a
|
||||
template file without creating a stack from it.
|
||||
@ -52,9 +56,11 @@ Create a stack from an example template file
|
||||
:command:`template-validate`, but it has been deprecated in favor of
|
||||
:command:`template-validate`.
|
||||
|
||||
To do so, run the following command::
|
||||
To do so, run the following command:
|
||||
|
||||
$ heat template-validate --template-file /PATH_TO_HEAT_TEMPLATES/WordPress_Single_Instance.template
|
||||
.. code-block:: console
|
||||
|
||||
$ heat template-validate --template-file /PATH_TO_HEAT_TEMPLATES/WordPress_Single_Instance.template
|
||||
|
||||
If validation fails, the response returns an error message.
|
||||
|
||||
@ -65,22 +71,28 @@ To explore the state and history of a particular stack, you can run a
|
||||
number of commands.
|
||||
|
||||
- To see which stacks are visible to the current user, run the
|
||||
following command::
|
||||
following command:
|
||||
|
||||
$ heat stack-list
|
||||
+------------------+---------------+-----------------+----------------------+
|
||||
| id | stack_name | stack_status | creation_time |
|
||||
+------------------+---------------+-----------------+----------------------+
|
||||
| 4c712026-dcd5... | mystack | CREATE_COMPLETE | 2013-04-03T23:22:08Z |
|
||||
| 7edc7480-bda5... | my-otherstack | CREATE_FAILED | 2013-04-03T23:28:20Z |
|
||||
+------------------+---------------+-----------------+----------------------+
|
||||
.. code-block:: console
|
||||
|
||||
- To show the details of a stack, run the following command::
|
||||
$ heat stack-list
|
||||
+------------------+---------------+-----------------+----------------------+
|
||||
| id | stack_name | stack_status | creation_time |
|
||||
+------------------+---------------+-----------------+----------------------+
|
||||
| 4c712026-dcd5... | mystack | CREATE_COMPLETE | 2013-04-03T23:22:08Z |
|
||||
| 7edc7480-bda5... | my-otherstack | CREATE_FAILED | 2013-04-03T23:28:20Z |
|
||||
+------------------+---------------+-----------------+----------------------+
|
||||
|
||||
- To show the details of a stack, run the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ heat stack-show mystack
|
||||
|
||||
- A stack consists of a collection of resources. To list the resources
|
||||
and their status, run the following command::
|
||||
and their status, run the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ heat resource-list mystack
|
||||
+---------------------+--------------------+-----------------+----------------------+
|
||||
@ -90,18 +102,24 @@ number of commands.
|
||||
+---------------------+--------------------+-----------------+----------------------+
|
||||
|
||||
- To show the details for a specific resource in a stack, run the
|
||||
following command::
|
||||
following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ heat resource-show mystack WikiDatabase
|
||||
|
||||
- Some resources have associated metadata which can change throughout
|
||||
the life cycle of a resource. Show the metadata by running the
|
||||
following command::
|
||||
following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ heat resource-metadata mystack WikiDatabase
|
||||
|
||||
- A series of events is generated during the life cycle of a stack. To
|
||||
display life cycle events, run the following command::
|
||||
display life cycle events, run the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ heat event-list mystack
|
||||
+---------------------+----+------------------------+-----------------+----------------------+
|
||||
@ -112,15 +130,19 @@ number of commands.
|
||||
+---------------------+----+------------------------+-----------------+----------------------+
|
||||
|
||||
- To show the details for a particular event, run the following
|
||||
command::
|
||||
command:
|
||||
|
||||
$ heat event-show WikiDatabase 1
|
||||
.. code-block:: console
|
||||
|
||||
$ heat event-show WikiDatabase 1
|
||||
|
||||
Update a stack
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
To update an existing stack from a modified template file, run a command
|
||||
like the following command::
|
||||
like the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ heat stack-update mystack --template-file \
|
||||
/path/to/heat/templates/WordPress_Single_Instance_v2.template \
|
||||
|
@ -93,10 +93,10 @@ define the response format:
|
||||
The following auto-extract archive files example shows a ``text/plain``
|
||||
response body where no failures occurred:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
Number Files Created: 10
|
||||
Errors:
|
||||
Number Files Created: 10
|
||||
Errors:
|
||||
|
||||
The following auto-extract archive files example shows a ``text/plain``
|
||||
response where some failures occurred. In this example, the Object
|
||||
@ -104,17 +104,17 @@ Storage system is configured to reject certain character strings so that
|
||||
the 400 Bad Request error occurs for any objects that use the restricted
|
||||
strings.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
Number Files Created: 8
|
||||
Errors:
|
||||
/v1/12345678912345/mycontainer/home/xx%3Cyy, 400 Bad Request
|
||||
/v1/12345678912345/mycontainer/../image.gif, 400 Bad Request
|
||||
Number Files Created: 8
|
||||
Errors:
|
||||
/v1/12345678912345/mycontainer/home/xx%3Cyy, 400 Bad Request
|
||||
/v1/12345678912345/mycontainer/../image.gif, 400 Bad Request
|
||||
|
||||
The following example shows the failure response in ``application/json``
|
||||
format.
|
||||
|
||||
.. code::
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"Number Files Created":1,
|
||||
|
@ -18,7 +18,7 @@ parameter to the path of a ``POST`` or ``DELETE`` operation.
|
||||
|
||||
.. note::
|
||||
|
||||
The ``DELETE`` operation is supported for backwards compatibility.
|
||||
The ``DELETE`` operation is supported for backwards compatibility.
|
||||
|
||||
The path is the account, such as ``/v1/12345678912345``, that contains
|
||||
the objects and containers.
|
||||
@ -78,16 +78,16 @@ The following bulk delete response is in ``application/xml`` format. In
|
||||
this example, the ``mycontainer`` container is not empty, so it cannot
|
||||
be deleted.
|
||||
|
||||
.. code::
|
||||
.. code-block:: xml
|
||||
|
||||
<delete>
|
||||
<number_deleted>2</number_deleted>
|
||||
<number_not_found>4</number_not_found>
|
||||
<errors>
|
||||
<object>
|
||||
<name>/v1/12345678912345/mycontainer</name>
|
||||
<status>409 Conflict</status>
|
||||
</object>
|
||||
</errors>
|
||||
</delete>
|
||||
<delete>
|
||||
<number_deleted>2</number_deleted>
|
||||
<number_not_found>4</number_not_found>
|
||||
<errors>
|
||||
<object>
|
||||
<name>/v1/12345678912345/mycontainer</name>
|
||||
<status>409 Conflict</status>
|
||||
</object>
|
||||
</errors>
|
||||
</delete>
|
||||
|
||||
|
@ -5,49 +5,49 @@ Create and manage containers
|
||||
- To create a container, run the following command and replace
|
||||
``CONTAINER`` with the name of your container.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post CONTAINER
|
||||
$ swift post CONTAINER
|
||||
|
||||
- To list all containers, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift list
|
||||
$ swift list
|
||||
|
||||
- To check the status of containers, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift stat
|
||||
$ swift stat
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
|
||||
Containers: 2
|
||||
Objects: 3
|
||||
Bytes: 268826
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1392683866.17952
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
|
||||
Containers: 2
|
||||
Objects: 3
|
||||
Bytes: 268826
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1392683866.17952
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
||||
You can also use the ``swift stat`` command with the ``ACCOUNT`` or
|
||||
You can also use the :command:`swift stat` command with the ``ACCOUNT`` or
|
||||
``CONTAINER`` names as parameters.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift stat CONTAINER
|
||||
$ swift stat CONTAINER
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
|
||||
Container: storage1
|
||||
Objects: 2
|
||||
Bytes: 240221
|
||||
Read ACL:
|
||||
Write ACL:
|
||||
Sync To:
|
||||
Sync Key:
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1392683866.20180
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
|
||||
Container: storage1
|
||||
Objects: 2
|
||||
Bytes: 240221
|
||||
Read ACL:
|
||||
Write ACL:
|
||||
Sync To:
|
||||
Sync Key:
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1392683866.20180
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
|
@ -18,25 +18,25 @@ use the ``/info`` request.
|
||||
To use the ``/info`` request, send a ``GET`` request using the ``/info``
|
||||
path to the Object Store endpoint as shown in this example:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl https://storage.example.com/info
|
||||
$ curl https://storage.example.com/info
|
||||
|
||||
This example shows a truncated response body:
|
||||
|
||||
.. code::
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"swift":{
|
||||
"version":"1.11.0"
|
||||
},
|
||||
"staticweb":{
|
||||
{
|
||||
"swift":{
|
||||
"version":"1.11.0"
|
||||
},
|
||||
"staticweb":{
|
||||
|
||||
},
|
||||
"tempurl":{
|
||||
},
|
||||
"tempurl":{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
This output shows that the Object Storage system has enabled the static
|
||||
website and temporary URL features.
|
||||
|
@ -16,21 +16,21 @@ publicURL
|
||||
token
|
||||
The authentication token for Object Storage.
|
||||
|
||||
To obtain these values, run the ``swift stat -v`` command.
|
||||
To obtain these values, run the :command:`swift stat -v` command.
|
||||
|
||||
As shown in this example, the public URL appears in the ``StorageURL``
|
||||
field, and the token appears in the ``Auth Token`` field:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
StorageURL: https://23.253.72.207/v1/my_account
|
||||
Auth Token: {token}
|
||||
Account: my_account
|
||||
Containers: 2
|
||||
Objects: 3
|
||||
Bytes: 47
|
||||
Meta Book: MobyDick
|
||||
X-Timestamp: 1389453423.35964
|
||||
X-Trans-Id: txee55498935404a2caad89-0052dd3b77
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Accept-Ranges: bytes
|
||||
StorageURL: https://23.253.72.207/v1/my_account
|
||||
Auth Token: {token}
|
||||
Account: my_account
|
||||
Containers: 2
|
||||
Objects: 3
|
||||
Bytes: 47
|
||||
Meta Book: MobyDick
|
||||
X-Timestamp: 1389453423.35964
|
||||
X-Trans-Id: txee55498935404a2caad89-0052dd3b77
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Accept-Ranges: bytes
|
||||
|
@ -34,24 +34,24 @@ To page through a large list of containers
|
||||
|
||||
Assume the following list of container names:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
apples
|
||||
bananas
|
||||
kiwis
|
||||
oranges
|
||||
pears
|
||||
apples
|
||||
bananas
|
||||
kiwis
|
||||
oranges
|
||||
pears
|
||||
|
||||
#. Use a ``limit`` of two:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
# curl -i $publicURL/?limit=2 -X GET -H "X-Auth-Token: $token"
|
||||
# curl -i $publicURL/?limit=2 -X GET -H "X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
apples
|
||||
bananas
|
||||
apples
|
||||
bananas
|
||||
|
||||
Because two container names are returned, there are more names to
|
||||
list.
|
||||
@ -59,28 +59,28 @@ Assume the following list of container names:
|
||||
#. Make another request with a ``marker`` parameter set to the name of
|
||||
the last item returned:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
# curl -i $publicURL/?limit=2&marker=bananas -X GET -H \
|
||||
“X-Auth-Token: $token"
|
||||
# curl -i $publicURL/?limit=2&marker=bananas -X GET -H \
|
||||
“X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
kiwis
|
||||
oranges
|
||||
kiwis
|
||||
oranges
|
||||
|
||||
Again, two items are returned, and there might be more.
|
||||
|
||||
#. Make another request with a ``marker`` of the last item returned:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
# curl -i $publicURL/?limit=2&marker=oranges -X GET -H \”
|
||||
X-Auth-Token: $token"
|
||||
# curl -i $publicURL/?limit=2&marker=oranges -X GET -H \”
|
||||
X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
pears
|
||||
pears
|
||||
|
||||
You receive a one-item response, which is fewer than the ``limit``
|
||||
number of names. This indicates that this is the end of the list.
|
||||
@ -88,16 +88,16 @@ Assume the following list of container names:
|
||||
#. Use the ``end_marker`` parameter to limit the result set to object
|
||||
names that are less than the ``end_marker`` parameter value:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
# curl -i $publicURL/?end_marker=oranges -X GET -H \”
|
||||
# curl -i $publicURL/?end_marker=oranges -X GET -H \”
|
||||
X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
apples
|
||||
bananas
|
||||
kiwis
|
||||
apples
|
||||
bananas
|
||||
kiwis
|
||||
|
||||
You receive a result set of all container names before the
|
||||
``end-marker`` value.
|
||||
|
@ -91,7 +91,7 @@ This example shows three segment objects. You can use several containers
|
||||
and the object names do not have to conform to a specific pattern, in
|
||||
contrast to dynamic large objects.
|
||||
|
||||
.. code::
|
||||
.. code-block:: json
|
||||
|
||||
[
|
||||
{
|
||||
@ -184,14 +184,14 @@ manifest is still available to download the first set of segments.
|
||||
Upload segment of large object request: HTTP
|
||||
--------------------------------------------
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
PUT /API_VERSION/ACCOUNT/CONTAINER/OBJECT HTTP/1.1
|
||||
Host: storage.example.com
|
||||
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
|
||||
ETag: 8a964ee2a5e88be344f36c22562a6486
|
||||
Content-Length: 1
|
||||
X-Object-Meta-PIN: 1234
|
||||
PUT /API_VERSION/ACCOUNT/CONTAINER/OBJECT HTTP/1.1
|
||||
Host: storage.example.com
|
||||
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
|
||||
ETag: 8a964ee2a5e88be344f36c22562a6486
|
||||
Content-Length: 1
|
||||
X-Object-Meta-PIN: 1234
|
||||
|
||||
No response body is returned. A status code of 2``nn`` (between 200
|
||||
and 299, inclusive) indicates a successful write; status 411 Length
|
||||
@ -206,14 +206,14 @@ uploading the manifest.
|
||||
Upload next segment of large object request: HTTP
|
||||
-------------------------------------------------
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
PUT /API_VERSION/ACCOUNT/CONTAINER/OBJECT HTTP/1.1
|
||||
Host: storage.example.com
|
||||
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
|
||||
ETag: 8a964ee2a5e88be344f36c22562a6486
|
||||
Content-Length: 1
|
||||
X-Object-Meta-PIN: 1234
|
||||
PUT /API_VERSION/ACCOUNT/CONTAINER/OBJECT HTTP/1.1
|
||||
Host: storage.example.com
|
||||
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
|
||||
ETag: 8a964ee2a5e88be344f36c22562a6486
|
||||
Content-Length: 1
|
||||
X-Object-Meta-PIN: 1234
|
||||
|
||||
Next, upload the manifest you created that indicates the container where
|
||||
the object segments reside. Note that uploading additional segments
|
||||
@ -224,18 +224,18 @@ subsequent additional segments.
|
||||
Upload manifest request: HTTP
|
||||
-----------------------------
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
PUT /API_VERSION/ACCOUNT/CONTAINER/OBJECT HTTP/1.1
|
||||
Host: storage.clouddrive.com
|
||||
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
|
||||
Content-Length: 0
|
||||
X-Object-Meta-PIN: 1234
|
||||
X-Object-Manifest: CONTAINER/PREFIX
|
||||
PUT /API_VERSION/ACCOUNT/CONTAINER/OBJECT HTTP/1.1
|
||||
Host: storage.clouddrive.com
|
||||
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
|
||||
Content-Length: 0
|
||||
X-Object-Meta-PIN: 1234
|
||||
X-Object-Manifest: CONTAINER/PREFIX
|
||||
|
||||
Upload manifest response: HTTP
|
||||
------------------------------
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
[...]
|
||||
|
||||
|
@ -8,16 +8,16 @@ Manage access
|
||||
lists for read and write access, which you set with the
|
||||
``X-Container-Read`` and ``X-Container-Write`` headers.
|
||||
|
||||
To give a user read access, use the ``swift post`` command with the
|
||||
``-r`` parameter. To give a user write access, use the ``-w``
|
||||
parameter.
|
||||
To give a user read access, use the :command:`swift post` command with the
|
||||
:option:`-r` parameter. To give a user write access, use the
|
||||
:option:`-w` parameter.
|
||||
|
||||
The following example enables the ``testuser`` user to read objects
|
||||
in the container:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -r 'testuser'
|
||||
$ swift post -r 'testuser'
|
||||
|
||||
You can also use this command with a list of users.
|
||||
|
||||
@ -27,6 +27,6 @@ Manage access
|
||||
|
||||
The following command gives object access to all referring domains:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -r '.r:*'
|
||||
$ swift post -r '.r:*'
|
||||
|
@ -4,43 +4,43 @@ Manage objects
|
||||
|
||||
- To upload an object to a container, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift upload CONTAINER OBJECT_FILENAME
|
||||
$ swift upload CONTAINER OBJECT_FILENAME
|
||||
|
||||
To upload in chunks, for large files, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift upload -S CHUNK_SIZE CONTAINER OBJECT_FILENAME
|
||||
$ swift upload -S CHUNK_SIZE CONTAINER OBJECT_FILENAME
|
||||
|
||||
- To check the status of the object, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift stat CONTAINER OBJECT_FILENAME
|
||||
$ swift stat CONTAINER OBJECT_FILENAME
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
|
||||
Container: storage1
|
||||
Object: images
|
||||
Content Type: application/octet-stream
|
||||
Content Length: 211616
|
||||
Last Modified: Tue, 18 Feb 2014 00:40:36 GMT
|
||||
ETag: 82169623d55158f70a0d720f238ec3ef
|
||||
Meta Orig-Filename: images.jpg
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1392684036.33306
|
||||
Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
|
||||
Container: storage1
|
||||
Object: images
|
||||
Content Type: application/octet-stream
|
||||
Content Length: 211616
|
||||
Last Modified: Tue, 18 Feb 2014 00:40:36 GMT
|
||||
ETag: 82169623d55158f70a0d720f238ec3ef
|
||||
Meta Orig-Filename: images.jpg
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1392684036.33306
|
||||
|
||||
- To list the objects in a container, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift list CONTAINER
|
||||
$ swift list CONTAINER
|
||||
|
||||
- To download an object from a container, run the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift download CONTAINER OBJECT_FILENAME
|
||||
$ swift download CONTAINER OBJECT_FILENAME
|
||||
|
@ -24,15 +24,15 @@ List pseudo-hierarchical folders request: HTTP
|
||||
To display a list of all the objects in the storage container, use
|
||||
``GET`` without a ``delimiter`` or ``prefix``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$publicurl/v1/AccountString/backups
|
||||
|
||||
The system returns status code 2xx (between 200 and 299, inclusive) and
|
||||
the requested list of the objects.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
photos/animals/cats/persian.jpg
|
||||
photos/animals/cats/siamese.jpg
|
||||
@ -47,9 +47,9 @@ Use the delimiter parameter to limit the displayed results. To use
|
||||
``delimiter`` with pseudo-directories, you must use the parameter slash
|
||||
(``/``).
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$publicurl/v1/AccountString/backups?delimiter=/
|
||||
|
||||
The system returns status code 2xx (between 200 and 299, inclusive) and
|
||||
@ -59,23 +59,23 @@ pseudo-directory ``photos/`` displays. The returned values from a slash
|
||||
``application/directory`` and are in the ``subdir`` section of JSON and
|
||||
XML results.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
photos/
|
||||
|
||||
Use the ``prefix`` and ``delimiter`` parameters to view the objects
|
||||
inside a pseudo-directory, including further nested pseudo-directories.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$publicurl/v1/AccountString/backups?prefix=photos/&delimiter=/
|
||||
|
||||
The system returns status code 2xx (between 200 and 299, inclusive) and
|
||||
the objects and pseudo-directories within the top level
|
||||
pseudo-directory.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
photos/animals/
|
||||
photos/me.jpg
|
||||
@ -88,15 +88,15 @@ pseudo-directory called ``dogs`` within the pseudo-directory
|
||||
``animals``. To navigate directly to the files contained within
|
||||
``dogs``, enter the following command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$ curl -X GET -i -H "X-Auth-Token: $token" \
|
||||
$publicurl/v1/AccountString/backups?prefix=photos/animals/dogs/&delimiter=/
|
||||
|
||||
The system returns status code 2xx (between 200 and 299, inclusive) and
|
||||
the objects and pseudo-directories within the nested pseudo-directory.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
photos/animals/dogs/corgi.jpg
|
||||
photos/animals/dogs/poodle.jpg
|
||||
|
@ -38,28 +38,28 @@ Example 1. JSON example with format query parameter
|
||||
For example, this request uses the ``format`` query parameter to ask
|
||||
for a JSON response:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL?format=json -X GET -H "X-Auth-Token: $token"
|
||||
$ curl -i $publicURL?format=json -X GET -H "X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 96
|
||||
X-Account-Object-Count: 1
|
||||
X-Timestamp: 1389453423.35964
|
||||
X-Account-Meta-Subject: Literature
|
||||
X-Account-Bytes-Used: 14
|
||||
X-Account-Container-Count: 2
|
||||
Content-Type: application/json; charset=utf-8
|
||||
Accept-Ranges: bytes
|
||||
X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365
|
||||
Date: Fri, 17 Jan 2014 15:59:33 GMT
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 96
|
||||
X-Account-Object-Count: 1
|
||||
X-Timestamp: 1389453423.35964
|
||||
X-Account-Meta-Subject: Literature
|
||||
X-Account-Bytes-Used: 14
|
||||
X-Account-Container-Count: 2
|
||||
Content-Type: application/json; charset=utf-8
|
||||
Accept-Ranges: bytes
|
||||
X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365
|
||||
Date: Fri, 17 Jan 2014 15:59:33 GMT
|
||||
|
||||
Object Storage lists container names with additional information in JSON
|
||||
format:
|
||||
|
||||
.. code::
|
||||
.. code-block:: json
|
||||
|
||||
[
|
||||
{
|
||||
@ -81,29 +81,29 @@ Example 2. XML example with Accept header
|
||||
This request uses the ``Accept`` request header to ask for an XML
|
||||
response:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL -X GET -H "X-Auth-Token: $token" -H \
|
||||
”Accept: application/xml; charset=utf-8"
|
||||
$ curl -i $publicURL -X GET -H "X-Auth-Token: $token" -H \
|
||||
”Accept: application/xml; charset=utf-8"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 263
|
||||
X-Account-Object-Count: 3
|
||||
X-Account-Meta-Book: MobyDick
|
||||
X-Timestamp: 1389453423.35964
|
||||
X-Account-Bytes-Used: 47
|
||||
X-Account-Container-Count: 2
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
Accept-Ranges: bytes
|
||||
X-Trans-Id: txf0b4c9727c3e491694019-0052e03420
|
||||
Date: Wed, 22 Jan 2014 21:12:00 GMT
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 263
|
||||
X-Account-Object-Count: 3
|
||||
X-Account-Meta-Book: MobyDick
|
||||
X-Timestamp: 1389453423.35964
|
||||
X-Account-Bytes-Used: 47
|
||||
X-Account-Container-Count: 2
|
||||
Content-Type: application/xml; charset=utf-8
|
||||
Accept-Ranges: bytes
|
||||
X-Trans-Id: txf0b4c9727c3e491694019-0052e03420
|
||||
Date: Wed, 22 Jan 2014 21:12:00 GMT
|
||||
|
||||
Object Storage lists container names with additional information in XML
|
||||
format:
|
||||
|
||||
.. code::
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<account name="AUTH_73f0aa26640f4971864919d0eb0f0880">
|
||||
|
@ -23,17 +23,17 @@ To enable and use object versioning
|
||||
|
||||
#. Create an ``archive`` container to store older versions of objects:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/archive -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token"
|
||||
$ curl -i $publicURL/archive -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Content-Length: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx46f8c29050834d88b8d7e-0052e1859d
|
||||
Date: Thu, 23 Jan 2014 21:11:57 GMT
|
||||
HTTP/1.1 201 Created
|
||||
Content-Length: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx46f8c29050834d88b8d7e-0052e1859d
|
||||
Date: Thu, 23 Jan 2014 21:11:57 GMT
|
||||
|
||||
#. Create a ``current`` container to store current versions of objects.
|
||||
|
||||
@ -45,35 +45,35 @@ To enable and use object versioning
|
||||
Changes to objects in the ``current`` container automatically create
|
||||
non-current versions in the ``archive`` container.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H \
|
||||
$ curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H \
|
||||
”X-Auth-Token: $token" -H "X-Versions-Location: archive"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Content-Length: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: txb91810fb717347d09eec8-0052e18997
|
||||
Date: Thu, 23 Jan 2014 21:28:55 GMT
|
||||
HTTP/1.1 201 Created
|
||||
Content-Length: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: txb91810fb717347d09eec8-0052e18997
|
||||
Date: Thu, 23 Jan 2014 21:28:55 GMT
|
||||
|
||||
#. Create the first version of an object in the ``current`` container:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/current/my_object --data-binary 1 -X PUT -H \
|
||||
$ curl -i $publicURL/current/my_object --data-binary 1 -X PUT -H \
|
||||
”Content-Length: 0" -H "X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Last-Modified: Thu, 23 Jan 2014 21:31:22 GMT
|
||||
Content-Length: 0
|
||||
Etag: d41d8cd98f00b204e9800998ecf8427e
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx5992d536a4bd4fec973aa-0052e18a2a
|
||||
Date: Thu, 23 Jan 2014 21:31:22 GMT
|
||||
HTTP/1.1 201 Created
|
||||
Last-Modified: Thu, 23 Jan 2014 21:31:22 GMT
|
||||
Content-Length: 0
|
||||
Etag: d41d8cd98f00b204e9800998ecf8427e
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx5992d536a4bd4fec973aa-0052e18a2a
|
||||
Date: Thu, 23 Jan 2014 21:31:22 GMT
|
||||
|
||||
Nothing is written to the non-current version container when you
|
||||
initially ``PUT`` an object in the ``current`` container. However,
|
||||
@ -82,9 +82,9 @@ To enable and use object versioning
|
||||
|
||||
These non-current versions are named as follows:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
<length><object_name><timestamp>
|
||||
<length><object_name><timestamp>
|
||||
|
||||
Where ``length`` is the 3-character, zero-padded hexadecimal
|
||||
character length of the object, ``<object_name>`` is the object name,
|
||||
@ -93,20 +93,20 @@ To enable and use object versioning
|
||||
|
||||
#. Create a second version of the object in the ``current`` container:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/current/my_object --data-binary 2 -X PUT -H \
|
||||
$ curl -i $publicURL/current/my_object --data-binary 2 -X PUT -H \
|
||||
“Content-Length: 0" -H "X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Last-Modified: Thu, 23 Jan 2014 21:41:32 GMT
|
||||
Content-Length: 0
|
||||
Etag: d41d8cd98f00b204e9800998ecf8427e
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx468287ce4fc94eada96ec-0052e18c8c
|
||||
Date: Thu, 23 Jan 2014 21:41:32 GMT
|
||||
HTTP/1.1 201 Created
|
||||
Last-Modified: Thu, 23 Jan 2014 21:41:32 GMT
|
||||
Content-Length: 0
|
||||
Etag: d41d8cd98f00b204e9800998ecf8427e
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx468287ce4fc94eada96ec-0052e18c8c
|
||||
Date: Thu, 23 Jan 2014 21:41:32 GMT
|
||||
|
||||
#. Issue a ``GET`` request to a versioned object to get the current
|
||||
version of the object. You do not have to do any request redirects or
|
||||
@ -114,22 +114,22 @@ To enable and use object versioning
|
||||
|
||||
List older versions of the object in the ``archive`` container:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/archive?prefix=009my_object -X GET -H \
|
||||
$ curl -i $publicURL/archive?prefix=009my_object -X GET -H \
|
||||
"X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 30
|
||||
X-Container-Object-Count: 1
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1390513280.79684
|
||||
X-Container-Bytes-Used: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
X-Trans-Id: tx9a441884997542d3a5868-0052e18d8e
|
||||
Date: Thu, 23 Jan 2014 21:45:50 GMT
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 30
|
||||
X-Container-Object-Count: 1
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1390513280.79684
|
||||
X-Container-Bytes-Used: 0
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
X-Trans-Id: tx9a441884997542d3a5868-0052e18d8e
|
||||
Date: Thu, 23 Jan 2014 21:45:50 GMT
|
||||
|
||||
009my_object/1390512682.92052
|
||||
|
||||
@ -143,38 +143,38 @@ To enable and use object versioning
|
||||
current version of the object and replace it with the next-most
|
||||
current version in the non-current container.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/current/my_object -X DELETE -H \
|
||||
$ curl -i $publicURL/current/my_object -X DELETE -H \
|
||||
"X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
Content-Length: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx006d944e02494e229b8ee-0052e18edd
|
||||
Date: Thu, 23 Jan 2014 21:51:25 GMT
|
||||
HTTP/1.1 204 No Content
|
||||
Content-Length: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx006d944e02494e229b8ee-0052e18edd
|
||||
Date: Thu, 23 Jan 2014 21:51:25 GMT
|
||||
|
||||
List objects in the ``archive`` container to show that the archived
|
||||
object was moved back to the ``current`` container:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/archive?prefix=009my_object -X GET -H \
|
||||
$ curl -i $publicURL/archive?prefix=009my_object -X GET -H \
|
||||
"X-Auth-Token: $token"
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
Content-Length: 0
|
||||
X-Container-Object-Count: 0
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1390513280.79684
|
||||
X-Container-Bytes-Used: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx044f2a05f56f4997af737-0052e18eed
|
||||
Date: Thu, 23 Jan 2014 21:51:41 GMT
|
||||
HTTP/1.1 204 No Content
|
||||
Content-Length: 0
|
||||
X-Container-Object-Count: 0
|
||||
Accept-Ranges: bytes
|
||||
X-Timestamp: 1390513280.79684
|
||||
X-Container-Bytes-Used: 0
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: tx044f2a05f56f4997af737-0052e18eed
|
||||
Date: Thu, 23 Jan 2014 21:51:41 GMT
|
||||
|
||||
This next-most current version carries with it any metadata last set
|
||||
on it. If you want to completely remove an object and you have five
|
||||
@ -184,17 +184,17 @@ To enable and use object versioning
|
||||
its ``X-Versions-Location`` metadata header by sending an empty key
|
||||
value.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H \
|
||||
$ curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H \
|
||||
"X-Auth-Token: $token" -H "X-Versions-Location: "
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
HTTP/1.1 202 Accepted
|
||||
Content-Length: 76
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: txe2476de217134549996d0-0052e19038
|
||||
Date: Thu, 23 Jan 2014 21:57:12 GMT
|
||||
HTTP/1.1 202 Accepted
|
||||
Content-Length: 76
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
X-Trans-Id: txe2476de217134549996d0-0052e19038
|
||||
Date: Thu, 23 Jan 2014 21:57:12 GMT
|
||||
|
||||
<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>
|
||||
<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>
|
||||
|
@ -51,15 +51,15 @@ The following sections show how to use Static Web middleware through
|
||||
Object Storage.
|
||||
|
||||
Make container publicly readable
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Make the container publicly readable. Once the container is publicly
|
||||
readable, you can access your objects directly, but you must set the
|
||||
index file to browse the main site URL and its sub-directories.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -r '.r:*' container
|
||||
$ swift post -r '.r:*' container
|
||||
|
||||
|
||||
Set site index file
|
||||
@ -68,9 +68,9 @@ Set site index file
|
||||
Set the index file. In this case, ``index.html`` is the default file
|
||||
displayed when the site appears.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -m 'web-index:index.html' container
|
||||
$ swift post -m 'web-index:index.html' container
|
||||
|
||||
Enable file listing
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
@ -79,18 +79,18 @@ Turn on file listing. If you do not set the index file, the URL displays
|
||||
a list of the objects in the container. Instructions on styling the list
|
||||
with a CSS follow.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -m 'web-listings: true' container
|
||||
$ swift post -m 'web-listings: true' container
|
||||
|
||||
Enable CSS for file listing
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Style the file listing using a CSS.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -m 'web-listings-css:listings.css' container
|
||||
$ swift post -m 'web-listings-css:listings.css' container
|
||||
|
||||
.. _set_error_static_website:
|
||||
|
||||
@ -116,9 +116,9 @@ for your entire static website.
|
||||
Set error pages for static website request
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ swift post -m 'web-error:error.html' container
|
||||
$ swift post -m 'web-error:error.html' container
|
||||
|
||||
|
||||
Any 2\ ``nn`` response indicates success.
|
||||
|
@ -20,24 +20,25 @@ Create and access a database
|
||||
sufficient to create database instances. You might need to create or
|
||||
obtain some new nova flavors that work for databases.
|
||||
|
||||
The first step is to list flavors by using the nova ``flavor-list``
|
||||
The first step is to list flavors by using the :command:`nova flavor-list`
|
||||
command.
|
||||
|
||||
Here are the default flavors, although you may have additional custom
|
||||
flavors in your environment:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ nova flavor-list
|
||||
+-----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
| 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 |
|
||||
+-----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
$ nova flavor-list
|
||||
|
||||
+-----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
| 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 |
|
||||
+-----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
|
||||
Now take a look at the minimum requirements for various database
|
||||
instances:
|
||||
@ -59,8 +60,8 @@ Create and access a database
|
||||
:ref:`Step 2 <create-database-instance>` and use that flavor.
|
||||
|
||||
- If your environment does not have a suitable flavor, an
|
||||
administrative user must create a custom flavor by using the nova
|
||||
``flavor-create`` command.
|
||||
administrative user must create a custom flavor by using the
|
||||
:command:`nova flavor-create` command.
|
||||
|
||||
**MySQL example.** This example creates a flavor that you can use
|
||||
with a MySQL database. This example has the following attributes:
|
||||
@ -76,14 +77,14 @@ Create and access a database
|
||||
|
||||
- Virtual CPUs: ``1``
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ nova flavor-create mysql-minimum 6 512 5 1
|
||||
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
|
||||
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
| 6 | mysql-minimum | 512 | 5 | 0 | | 1 | 1.0 | True |
|
||||
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
$ nova flavor-create mysql-minimum 6 512 5 1
|
||||
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
|
||||
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
| 6 | mysql-minimum | 512 | 5 | 0 | | 1 | 1.0 | True |
|
||||
+----+---------------+-----------+------+-----------+------+-------+-------------+-----------+
|
||||
|
||||
.. _create-database-instance:
|
||||
|
||||
@ -107,62 +108,63 @@ Create and access a database
|
||||
|
||||
- The ``userA`` user with the ``password`` password.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove create mysql_instance_1 6 --size 5 --databases myDB \
|
||||
--users userA:password --datastore_version mysql-5.5 \
|
||||
--datastore mysql
|
||||
+-------------------+---------------------------------------------------------------------------------------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} |
|
||||
+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
$ trove create mysql_instance_1 6 --size 5 --databases myDB \
|
||||
--users userA:password --datastore_version mysql-5.5 \
|
||||
--datastore mysql
|
||||
+-------------------+---------------------------------------------------------------------------------------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} |
|
||||
+-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
#. **Get the IP address of the database instance**
|
||||
|
||||
First, use the trove ``list`` command to list all instances and their
|
||||
IDs:
|
||||
First, use the :command:`trove list` command to list all instances and
|
||||
their IDs:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove list
|
||||
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| 5599dad6-731e-44df-bb60-488da3da9cfe | mysql_instance_1 | mysql | mysql-5.5 | BUILD | 6 | 5 |
|
||||
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
$ trove list
|
||||
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| 5599dad6-731e-44df-bb60-488da3da9cfe | mysql_instance_1 | mysql | mysql-5.5 | BUILD | 6 | 5 |
|
||||
+--------------------------------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
|
||||
This command returns the instance ID of your new instance.
|
||||
|
||||
You can now pass in the instance ID with the trove ``show`` command
|
||||
You can now pass in the instance ID with the :command:`trove show` command
|
||||
to get the IP address of the instance. In this example, replace
|
||||
``INSTANCE_ID`` with ``5599dad6-731e-44df-bb60-488da3da9cfe``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove show INSTANCE_ID
|
||||
+-------------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------------+--------------------------------------+
|
||||
$ trove show INSTANCE_ID
|
||||
|
||||
+-------------------+--------------------------------------+
|
||||
| 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 |
|
||||
+-------------------+--------------------------------------+
|
||||
|
||||
This command returns the IP address of the database instance.
|
||||
|
||||
@ -172,7 +174,7 @@ Create and access a database
|
||||
typical database access commands. In this MySQL example, replace
|
||||
``IP_ADDRESS`` with ``172.16.200.2``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ mysql -u userA -ppassword -h IP_ADDRESS myDB
|
||||
$ mysql -u userA -ppassword -h IP_ADDRESS myDB
|
||||
|
||||
|
@ -15,7 +15,7 @@ environment. This can provide significant time savings in managing your
|
||||
cloud.
|
||||
|
||||
Bulk-configure a database or databases
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
#. **List available options**
|
||||
|
||||
@ -25,76 +25,78 @@ Bulk-configure a database or databases
|
||||
List the names and IDs of all available versions of the ``mysql``
|
||||
data store:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove datastore-version-list mysql
|
||||
+--------------------------------------+-----------+
|
||||
| id | name |
|
||||
+--------------------------------------+-----------+
|
||||
| eeb574ce-f49a-48b6-820d-b2959fcd38bb | mysql-5.5 |
|
||||
+--------------------------------------+-----------+
|
||||
$ trove datastore-version-list mysql
|
||||
|
||||
Pass in the data store version ID with the trove
|
||||
``configuration-parameter-list`` command to get the available
|
||||
+--------------------------------------+-----------+
|
||||
| id | name |
|
||||
+--------------------------------------+-----------+
|
||||
| eeb574ce-f49a-48b6-820d-b2959fcd38bb | mysql-5.5 |
|
||||
+--------------------------------------+-----------+
|
||||
|
||||
Pass in the data store version ID with the
|
||||
:command:`trove configuration-parameter-list` command to get the available
|
||||
options:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove configuration-parameter-list DATASTORE_VERSION_ID
|
||||
+--------------------------------+---------+---------+----------------------+------------------+
|
||||
| name | type | min | max | restart_required |
|
||||
+--------------------------------+---------+---------+----------------------+------------------+
|
||||
| auto_increment_increment | integer | 1 | 65535 | False |
|
||||
| auto_increment_offset | integer | 1 | 65535 | False |
|
||||
| autocommit | integer | 0 | 1 | False |
|
||||
| bulk_insert_buffer_size | integer | 0 | 18446744073709547520 | False |
|
||||
| character_set_client | string | | | False |
|
||||
| character_set_connection | string | | | False |
|
||||
| character_set_database | string | | | False |
|
||||
| character_set_filesystem | string | | | False |
|
||||
| character_set_results | string | | | False |
|
||||
| character_set_server | string | | | False |
|
||||
| collation_connection | string | | | False |
|
||||
| collation_database | string | | | False |
|
||||
| collation_server | string | | | False |
|
||||
| connect_timeout | integer | 1 | 65535 | False |
|
||||
| expire_logs_days | integer | 1 | 65535 | False |
|
||||
| innodb_buffer_pool_size | integer | 0 | 68719476736 | True |
|
||||
| innodb_file_per_table | integer | 0 | 1 | True |
|
||||
| innodb_flush_log_at_trx_commit | integer | 0 | 2 | False |
|
||||
| innodb_log_buffer_size | integer | 1048576 | 4294967296 | True |
|
||||
| innodb_open_files | integer | 10 | 4294967296 | True |
|
||||
| innodb_thread_concurrency | integer | 0 | 1000 | False |
|
||||
| interactive_timeout | integer | 1 | 65535 | False |
|
||||
| join_buffer_size | integer | 0 | 4294967296 | False |
|
||||
| key_buffer_size | integer | 0 | 4294967296 | False |
|
||||
| local_infile | integer | 0 | 1 | False |
|
||||
| max_allowed_packet | integer | 1024 | 1073741824 | False |
|
||||
| max_connect_errors | integer | 1 | 18446744073709547520 | False |
|
||||
| max_connections | integer | 1 | 65535 | False |
|
||||
| max_user_connections | integer | 1 | 100000 | False |
|
||||
| myisam_sort_buffer_size | integer | 4 | 18446744073709547520 | False |
|
||||
| server_id | integer | 1 | 100000 | True |
|
||||
| sort_buffer_size | integer | 32768 | 18446744073709547520 | False |
|
||||
| sync_binlog | integer | 0 | 18446744073709547520 | False |
|
||||
| wait_timeout | integer | 1 | 31536000 | False |
|
||||
+--------------------------------+---------+---------+----------------------+------------------+
|
||||
$ trove configuration-parameter-list DATASTORE_VERSION_ID
|
||||
|
||||
In this example, the ``configuration-parameter-list`` command returns
|
||||
a list of options that work with MySQL 5.5.
|
||||
+--------------------------------+---------+---------+----------------------+------------------+
|
||||
| name | type | min | max | restart_required |
|
||||
+--------------------------------+---------+---------+----------------------+------------------+
|
||||
| auto_increment_increment | integer | 1 | 65535 | False |
|
||||
| auto_increment_offset | integer | 1 | 65535 | False |
|
||||
| autocommit | integer | 0 | 1 | False |
|
||||
| bulk_insert_buffer_size | integer | 0 | 18446744073709547520 | False |
|
||||
| character_set_client | string | | | False |
|
||||
| character_set_connection | string | | | False |
|
||||
| character_set_database | string | | | False |
|
||||
| character_set_filesystem | string | | | False |
|
||||
| character_set_results | string | | | False |
|
||||
| character_set_server | string | | | False |
|
||||
| collation_connection | string | | | False |
|
||||
| collation_database | string | | | False |
|
||||
| collation_server | string | | | False |
|
||||
| connect_timeout | integer | 1 | 65535 | False |
|
||||
| expire_logs_days | integer | 1 | 65535 | False |
|
||||
| innodb_buffer_pool_size | integer | 0 | 68719476736 | True |
|
||||
| innodb_file_per_table | integer | 0 | 1 | True |
|
||||
| innodb_flush_log_at_trx_commit | integer | 0 | 2 | False |
|
||||
| innodb_log_buffer_size | integer | 1048576 | 4294967296 | True |
|
||||
| innodb_open_files | integer | 10 | 4294967296 | True |
|
||||
| innodb_thread_concurrency | integer | 0 | 1000 | False |
|
||||
| interactive_timeout | integer | 1 | 65535 | False |
|
||||
| join_buffer_size | integer | 0 | 4294967296 | False |
|
||||
| key_buffer_size | integer | 0 | 4294967296 | False |
|
||||
| local_infile | integer | 0 | 1 | False |
|
||||
| max_allowed_packet | integer | 1024 | 1073741824 | False |
|
||||
| max_connect_errors | integer | 1 | 18446744073709547520 | False |
|
||||
| max_connections | integer | 1 | 65535 | False |
|
||||
| max_user_connections | integer | 1 | 100000 | False |
|
||||
| myisam_sort_buffer_size | integer | 4 | 18446744073709547520 | False |
|
||||
| server_id | integer | 1 | 100000 | True |
|
||||
| sort_buffer_size | integer | 32768 | 18446744073709547520 | False |
|
||||
| sync_binlog | integer | 0 | 18446744073709547520 | False |
|
||||
| wait_timeout | integer | 1 | 31536000 | False |
|
||||
+--------------------------------+---------+---------+----------------------+------------------+
|
||||
|
||||
In this example, the :command:`configuration-parameter-list` command
|
||||
returns a list of options that work with MySQL 5.5.
|
||||
|
||||
#. **Create a configuration group**
|
||||
|
||||
A configuration group contains a comma-separated list of key-value
|
||||
pairs. Each pair consists of a configuration option and its value.
|
||||
|
||||
You can create a configuration group by using the trove
|
||||
``configuration-create`` command. The general syntax for this command
|
||||
is:
|
||||
You can create a configuration group by using the
|
||||
:command:`trove configuration-create` command. The general syntax
|
||||
for this command is:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove configuration-create NAME VALUES --datastore DATASTORE_NAME
|
||||
$ trove configuration-create NAME VALUES --datastore DATASTORE_NAME
|
||||
|
||||
- *NAME*. The name you want to use for this group.
|
||||
|
||||
@ -104,26 +106,27 @@ Bulk-configure a database or databases
|
||||
|
||||
Set *VALUES* as a JSON dictionary, for example:
|
||||
|
||||
.. code::
|
||||
.. code-block:: json
|
||||
|
||||
{"myFirstKey" : "someString", "mySecondKey" : someInt}
|
||||
{"myFirstKey" : "someString", "mySecondKey" : someInt}
|
||||
|
||||
This example creates a configuration group called ``group1``.
|
||||
``group1`` contains just one key and value pair, and this pair sets
|
||||
the ``sync_binlog`` option to ``1``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove configuration-create group1 '{"sync_binlog" : 1}' --datastore mysql
|
||||
+----------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+----------------------+--------------------------------------+
|
||||
| datastore_version_id | eeb574ce-f49a-48b6-820d-b2959fcd38bb |
|
||||
| description | None |
|
||||
| id | 9a9ef3bc-079b-476a-9cbf-85aa64f898a5 |
|
||||
| name | group1 |
|
||||
| values | {"sync_binlog": 1} |
|
||||
+----------------------+--------------------------------------+
|
||||
$ trove configuration-create group1 '{"sync_binlog" : 1}' --datastore mysql
|
||||
|
||||
+----------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+----------------------+--------------------------------------+
|
||||
| datastore_version_id | eeb574ce-f49a-48b6-820d-b2959fcd38bb |
|
||||
| description | None |
|
||||
| id | 9a9ef3bc-079b-476a-9cbf-85aa64f898a5 |
|
||||
| name | group1 |
|
||||
| values | {"sync_binlog": 1} |
|
||||
+----------------------+--------------------------------------+
|
||||
|
||||
#. **Examine your existing configuration**
|
||||
|
||||
@ -132,9 +135,9 @@ Bulk-configure a database or databases
|
||||
following sample connection values with values that connect to your
|
||||
database:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ mysql -u user7 -ppassword -h 172.16.200.2 myDB7
|
||||
$ mysql -u user7 -ppassword -h 172.16.200.2 myDB7
|
||||
Welcome to the MySQL monitor. Commands end with ; or \g.
|
||||
...
|
||||
mysql> show variables like 'sync_binlog';
|
||||
@ -151,46 +154,50 @@ Bulk-configure a database or databases
|
||||
|
||||
You can change a database's configuration by attaching a
|
||||
configuration group to a database instance. You do this by using the
|
||||
trove ``configuration-attach`` command and passing in the ID of the
|
||||
:command:`trove configuration-attach` command and passing in the ID of the
|
||||
database instance and the ID of the configuration group.
|
||||
|
||||
Get the ID of the database instance:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove list
|
||||
+-------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+-------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| 26a265dd... | mysql_instance_7 | mysql | mysql-5.5 | ACTIVE | 6 | 5 |
|
||||
+-------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
$ trove list
|
||||
|
||||
+-------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+-------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
| 26a265dd... | mysql_instance_7 | mysql | mysql-5.5 | ACTIVE | 6 | 5 |
|
||||
+-------------+------------------+-----------+-------------------+--------+-----------+------+
|
||||
|
||||
Get the ID of the configuration group:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove configuration-list
|
||||
+-------------+--------+-------------+---------------------+
|
||||
| id | name | description |datastore_version_id |
|
||||
+-------------+--------+-------------+---------------------+
|
||||
| 9a9ef3bc... | group1 | None | eeb574ce... |
|
||||
+-------------+--------+-------------+---------------------+
|
||||
$ trove configuration-list
|
||||
|
||||
+-------------+--------+-------------+---------------------+
|
||||
| id | name | description |datastore_version_id |
|
||||
+-------------+--------+-------------+---------------------+
|
||||
| 9a9ef3bc... | group1 | None | eeb574ce... |
|
||||
+-------------+--------+-------------+---------------------+
|
||||
|
||||
Attach the configuration group to the database instance:
|
||||
|
||||
.. note:: This command syntax pertains only to python-troveclient version
|
||||
.. note::
|
||||
|
||||
This command syntax pertains only to python-troveclient version
|
||||
1.0.6 and later. Earlier versions require you to pass in the
|
||||
configuration group ID as the first argument.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove configuration-attach DB_INSTANCE_ID CONFIG_GROUP_ID
|
||||
$ trove configuration-attach DB_INSTANCE_ID CONFIG_GROUP_ID
|
||||
|
||||
#. **Re-examine the database configuration**
|
||||
|
||||
Display the ``sync_binlog`` setting again:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
mysql> show variables like 'sync_binlog';
|
||||
+---------------+-------+
|
||||
@ -218,15 +225,15 @@ cloud configuration, on the fly, on a massive scale.
|
||||
features for working with configuration groups. You can:
|
||||
|
||||
- Disassociate a configuration group from a database instance, using
|
||||
the trove ``configuration-detach`` command.
|
||||
the :command:`trove configuration-detach` command.
|
||||
|
||||
- Modify a configuration group on the fly, using the trove
|
||||
``configuration-patch`` command.
|
||||
- Modify a configuration group on the fly, using the
|
||||
:command:`trove configuration-patch` command.
|
||||
|
||||
- Find out what instances are using a configuration group, using the
|
||||
trove ``configuration-instances`` command.
|
||||
:command:`trove configuration-instances` command.
|
||||
|
||||
- Delete a configuration group, using the trove
|
||||
``configuration-delete`` command. You might want to do this if no
|
||||
instances use a group.
|
||||
- Delete a configuration group, using the
|
||||
:command:`trove configuration-delete` command. You might want to
|
||||
to do this if no instances use a group.
|
||||
|
||||
|
@ -20,7 +20,9 @@ You can only assign these headers to objects. For more information, see
|
||||
`www.w3.org/TR/access-control/ <http://www.w3.org/TR/access-control/>`__.
|
||||
|
||||
This example assigns the file origin to the ``Origin`` header, which
|
||||
ensures that the file originated from a reputable source::
|
||||
ensures that the file originated from a reputable source.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i -X POST -H "Origin: example.com" -H "X-Auth-Token:
|
||||
48e17715dfce47bb90dc2a336f63493a"
|
||||
|
@ -36,5 +36,6 @@ If the OpenStack cloud is configured to use public-key infrastructure
|
||||
fhuUpJT-s9mU7+WEC3-8qkcBjEpqVCvMpmM4INI=
|
||||
|
||||
.. note::
|
||||
|
||||
This example shows a subset of a PKI token. A complete token is over
|
||||
5000 characters long.
|
||||
|
@ -22,7 +22,7 @@ To list the available images, call the
|
||||
The images method returns a Python generator, as shown in the following
|
||||
interaction with the Python interpreter:
|
||||
|
||||
::
|
||||
.. code-block:: python
|
||||
|
||||
>>> images = glance.images.list()
|
||||
>>> images
|
||||
|
@ -29,6 +29,7 @@ X-Delete-After
|
||||
seconds.
|
||||
|
||||
.. note::
|
||||
|
||||
Use http://www.epochconverter.com/ to convert dates to and from
|
||||
epoch timestamps and for batch conversions.
|
||||
|
||||
@ -38,16 +39,16 @@ that you want to expire.
|
||||
In this example, the ``X-Delete-At`` header is assigned a UNIX epoch
|
||||
timestamp in integer form for ``Mon, 11 Jun 2012 15:38:25 GMT``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ curl -i publicURL/marktwain/goodbye -X PUT -H "X-Auth-Token: token" \
|
||||
-H "X-Delete-At: 1390581073" -H "Content-Length: 14" -H \
|
||||
"Content-Type: application/octet-stream"
|
||||
-H "X-Delete-At: 1390581073" -H "Content-Length: 14" -H \
|
||||
"Content-Type: application/octet-stream"
|
||||
|
||||
In this example, the ``X-Delete-After`` header is set to 864000 seconds.
|
||||
The object expires after this time.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
PUT /<api version>/<account>/<container>/<object> HTTP/1.1
|
||||
Host: storage.example.com
|
||||
|
@ -21,7 +21,9 @@ Each cluster includes:
|
||||
|
||||
This example shows you how to set up a MongoDB sharded cluster.
|
||||
|
||||
.. note:: **Before you begin.** Make sure that:
|
||||
.. note::
|
||||
|
||||
**Before you begin.** Make sure that:
|
||||
|
||||
- The administrative user has registered a MongoDB datastore type and
|
||||
version.
|
||||
@ -34,7 +36,7 @@ Set up clustering
|
||||
|
||||
#. **Create a cluster**
|
||||
|
||||
Create a cluster by using the trove ``cluster-create`` command. This
|
||||
Create a cluster by using the :command:`trove cluster-create` command. This
|
||||
command creates a one-shard cluster. Pass in:
|
||||
|
||||
- The name of the cluster.
|
||||
@ -42,17 +44,18 @@ Set up clustering
|
||||
- The name and version of the datastore you want to use.
|
||||
|
||||
- The three instances you want to include in the replication set for
|
||||
the first shard. Specify each instance by using the ``--instance``
|
||||
the first shard. Specify each instance by using the :option:`--instance`
|
||||
argument and the associated flavor ID and volume size. Use the
|
||||
same flavor ID and volume size for each instance. In this example,
|
||||
flavor ``7`` is a custom flavor that meets the MongoDB minimum
|
||||
requirements.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove cluster-create cluster1 mongodb "2.4" \
|
||||
--instance flavor_id=7,volume=2 --instance flavor_id=7,volume=2 \
|
||||
--instance flavor_id=7,volume=2
|
||||
|
||||
$ trove cluster-create cluster1 mongodb "2.4" \
|
||||
--instance flavor_id=7,volume=2 --instance flavor_id=7,volume=2 \
|
||||
--instance flavor_id=7,volume=2
|
||||
+-------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------------+--------------------------------------+
|
||||
@ -68,16 +71,17 @@ Set up clustering
|
||||
|
||||
#. **Display cluster information**
|
||||
|
||||
Display information about a cluster by using the trove
|
||||
``cluster-show`` command. Pass in the ID of the cluster.
|
||||
Display information about a cluster by using the
|
||||
:command:`trove cluster-show` command. Pass in the ID of the cluster.
|
||||
|
||||
The cluster ID displays when you first create a cluster. (If you need
|
||||
to find it later on, use the trove ``cluster-list`` command to list
|
||||
to find it later on, use the :command:`trove cluster-list` command to list
|
||||
the names and IDs of all the clusters in your system.)
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove cluster-show CLUSTER_ID
|
||||
|
||||
$ trove cluster-show CLUSTER_ID
|
||||
+-------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------------+--------------------------------------+
|
||||
@ -93,26 +97,29 @@ Set up clustering
|
||||
+-------------------+--------------------------------------+
|
||||
|
||||
|
||||
.. note:: **Your application connects to this IP address.** The trove
|
||||
``cluster-show`` command displays the IP address of the query router.
|
||||
.. note::
|
||||
|
||||
**Your application connects to this IP address.** The trove
|
||||
:command:`cluster-show` command displays the IP address of the query router.
|
||||
This is the IP address your application uses to retrieve data from
|
||||
the database.
|
||||
|
||||
#. **List cluster instances**
|
||||
|
||||
List the instances in a cluster by using the trove
|
||||
``cluster-instances`` command.
|
||||
List the instances in a cluster by using the
|
||||
:command:`trove cluster-instances` command.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove cluster-instances CLUSTER_ID
|
||||
+--------------------------------------+----------------+-----------+------+
|
||||
| ID | Name | Flavor ID | Size |
|
||||
+--------------------------------------+----------------+-----------+------+
|
||||
| 45532fc4-661c-4030-8ca4-18f02aa2b337 | cluster1-rs1-1 | 7 | 2 |
|
||||
| 7458a98d-6f89-4dfd-bb61-5cf1dd65c121 | cluster1-rs1-2 | 7 | 2 |
|
||||
| b37634fb-e33c-4846-8fe8-cf2b2c95e731 | cluster1-rs1-3 | 7 | 2 |
|
||||
+--------------------------------------+----------------+-----------+------+
|
||||
$ trove cluster-instances CLUSTER_ID
|
||||
|
||||
+--------------------------------------+----------------+-----------+------+
|
||||
| ID | Name | Flavor ID | Size |
|
||||
+--------------------------------------+----------------+-----------+------+
|
||||
| 45532fc4-661c-4030-8ca4-18f02aa2b337 | cluster1-rs1-1 | 7 | 2 |
|
||||
| 7458a98d-6f89-4dfd-bb61-5cf1dd65c121 | cluster1-rs1-2 | 7 | 2 |
|
||||
| b37634fb-e33c-4846-8fe8-cf2b2c95e731 | cluster1-rs1-3 | 7 | 2 |
|
||||
+--------------------------------------+----------------+-----------+------+
|
||||
|
||||
**Naming conventions for replication sets and instances.** Note
|
||||
that the ``Name`` column displays an instance name that includes the
|
||||
@ -134,26 +141,27 @@ Set up clustering
|
||||
|
||||
#. **List clusters**
|
||||
|
||||
List all the clusters in your system, using the trove
|
||||
``cluster-list`` command.
|
||||
List all the clusters in your system, using the
|
||||
:command:`trove cluster-list` command.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove cluster-list
|
||||
+--------------------------------------+----------+-----------+-------------------+-----------+
|
||||
| ID | Name | Datastore | Datastore Version | Task Name |
|
||||
+--------------------------------------+----------+-----------+-------------------+-----------+
|
||||
| aa6ef0f5-dbef-48cd-8952-573ad881e717 | cluster1 | mongodb | 2.4 | NONE |
|
||||
| b8829c2a-b03a-49d3-a5b1-21ec974223ee | cluster2 | mongodb | 2.4 | BUILDING |
|
||||
+--------------------------------------+----------+-----------+-------------------+-----------+
|
||||
$ trove cluster-list
|
||||
|
||||
+--------------------------------------+----------+-----------+-------------------+-----------+
|
||||
| ID | Name | Datastore | Datastore Version | Task Name |
|
||||
+--------------------------------------+----------+-----------+-------------------+-----------+
|
||||
| aa6ef0f5-dbef-48cd-8952-573ad881e717 | cluster1 | mongodb | 2.4 | NONE |
|
||||
| b8829c2a-b03a-49d3-a5b1-21ec974223ee | cluster2 | mongodb | 2.4 | BUILDING |
|
||||
+--------------------------------------+----------+-----------+-------------------+-----------+
|
||||
|
||||
#. **Delete a cluster**
|
||||
|
||||
Delete a cluster, using the trove ``cluster-delete`` command.
|
||||
Delete a cluster, using the :command:`trove cluster-delete` command.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove cluster-delete CLUSTER_ID
|
||||
$ trove cluster-delete CLUSTER_ID
|
||||
|
||||
Query routers and config servers
|
||||
--------------------------------
|
||||
|
@ -8,8 +8,8 @@ applies those changes to the replica.
|
||||
|
||||
- Replicas are read-only.
|
||||
|
||||
- When you create a replica, do not specify the ``--users`` or
|
||||
``--databases`` options.
|
||||
- When you create a replica, do not specify the :option:`--users` or
|
||||
:option:`--databases` options.
|
||||
|
||||
- You can choose a smaller volume or flavor for a replica than for the
|
||||
original, but the replica's volume must be big enough to hold the
|
||||
@ -24,77 +24,80 @@ Set up replication
|
||||
|
||||
Get the ID of the original instance you want to replicate:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove list
|
||||
+-----------+------------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+-----------+------------+-----------+-------------------+--------+-----------+------+
|
||||
| 97b...ae6 | base_1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
+-----------+------------+-----------+-------------------+--------+-----------+------+
|
||||
$ trove list
|
||||
|
||||
+-----------+------------+-----------+-------------------+--------+-----------+------+
|
||||
| id | name | datastore | datastore_version | status | flavor_id | size |
|
||||
+-----------+------------+-----------+-------------------+--------+-----------+------+
|
||||
| 97b...ae6 | base_1 | mysql | mysql-5.5 | ACTIVE | 10 | 2 |
|
||||
+-----------+------------+-----------+-------------------+--------+-----------+------+
|
||||
|
||||
#. **Create the replica**
|
||||
|
||||
Create a new instance that will be a replica of the original
|
||||
instance. You do this by passing in the ``--replica_of`` option with
|
||||
the trove ``create`` command. This example creates a replica
|
||||
instance. You do this by passing in the :option:`--replica_of` option with
|
||||
the :command:`trove create` command. This example creates a replica
|
||||
called ``replica_1``. ``replica_1`` is a replica of the original instance,
|
||||
``base_1``:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove create replica_1 6 --size=5 --datastore_version mysql-5.5 \
|
||||
--datastore mysql --replica_of ID_OF_ORIGINAL_INSTANCE
|
||||
$ trove create replica_1 6 --size=5 --datastore_version mysql-5.5 \
|
||||
--datastore mysql --replica_of ID_OF_ORIGINAL_INSTANCE
|
||||
|
||||
#. **Verify replication status**
|
||||
|
||||
Pass in ``replica_1``'s instance ID with the trove ``show`` command
|
||||
Pass in ``replica_1``'s instance ID with the :command:`trove show` command
|
||||
to verify that the newly created ``replica_1`` instance is a replica
|
||||
of the original ``base_1``. Note that the ``replica_of`` property is
|
||||
set to the ID of ``base_1``.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove show INSTANCE_ID_OF_REPLICA_1
|
||||
+-------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------------+--------------------------------------+
|
||||
| created | 2014-09-16T11:16:49 |
|
||||
| datastore | mysql |
|
||||
| datastore_version | mysql-5.5 |
|
||||
| flavor | 6 |
|
||||
| id | 49c6eff6-ef91-4eff-91c0-efbda7e83c38 |
|
||||
| name | replica_1 |
|
||||
| replica_of | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 |
|
||||
| status | BUILD |
|
||||
| updated | 2014-09-16T11:16:49 |
|
||||
| volume | 5 |
|
||||
+-------------------+--------------------------------------+
|
||||
$ trove show INSTANCE_ID_OF_REPLICA_1
|
||||
|
||||
Now pass in ``base_1``'s instance ID with the trove ``show`` command
|
||||
+-------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------------+--------------------------------------+
|
||||
| created | 2014-09-16T11:16:49 |
|
||||
| datastore | mysql |
|
||||
| datastore_version | mysql-5.5 |
|
||||
| flavor | 6 |
|
||||
| id | 49c6eff6-ef91-4eff-91c0-efbda7e83c38 |
|
||||
| name | replica_1 |
|
||||
| replica_of | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 |
|
||||
| status | BUILD |
|
||||
| updated | 2014-09-16T11:16:49 |
|
||||
| volume | 5 |
|
||||
+-------------------+--------------------------------------+
|
||||
|
||||
Now pass in ``base_1``'s instance ID with the :command:`trove show` command
|
||||
to list the replica(s) associated with the original instance. Note
|
||||
that the ``replicas`` property is set to the ID of ``replica_1``. If
|
||||
there are multiple replicas, they appear as a comma-separated list.
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove show INSTANCE_ID_OF_BASE_1
|
||||
+-------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------------+--------------------------------------+
|
||||
| created | 2014-09-16T11:04:56 |
|
||||
| datastore | mysql |
|
||||
| datastore_version | mysql-5.5 |
|
||||
| flavor | 6 |
|
||||
| id | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 |
|
||||
| ip | 172.16.200.2 |
|
||||
| name | base_1 |
|
||||
| replicas | 49c6eff6-ef91-4eff-91c0-efbda7e83c38 |
|
||||
| status | ACTIVE |
|
||||
| updated | 2014-09-16T11:05:06 |
|
||||
| volume | 5 |
|
||||
| volume_used | 0.11 |
|
||||
+-------------------+--------------------------------------+
|
||||
$ trove show INSTANCE_ID_OF_BASE_1
|
||||
|
||||
+-------------------+--------------------------------------+
|
||||
| Property | Value |
|
||||
+-------------------+--------------------------------------+
|
||||
| created | 2014-09-16T11:04:56 |
|
||||
| datastore | mysql |
|
||||
| datastore_version | mysql-5.5 |
|
||||
| flavor | 6 |
|
||||
| id | 97b4b853-80f6-414f-ba6f-c6f455a79ae6 |
|
||||
| ip | 172.16.200.2 |
|
||||
| name | base_1 |
|
||||
| replicas | 49c6eff6-ef91-4eff-91c0-efbda7e83c38 |
|
||||
| status | ACTIVE |
|
||||
| updated | 2014-09-16T11:05:06 |
|
||||
| volume | 5 |
|
||||
| volume_used | 0.11 |
|
||||
+-------------------+--------------------------------------+
|
||||
|
||||
#. **Detach the replica**
|
||||
|
||||
@ -102,9 +105,9 @@ Set up replication
|
||||
replica becomes a standalone database instance. You can then take the
|
||||
new standalone instance and create a new replica of that instance.
|
||||
|
||||
You detach a replica using the trove ``detach-replica`` command:
|
||||
You detach a replica using the :command:`trove detach-replica` command:
|
||||
|
||||
.. code::
|
||||
.. code-block:: console
|
||||
|
||||
$ trove detach-replica INSTANCE_ID_OF_REPLICA
|
||||
$ trove detach-replica INSTANCE_ID_OF_REPLICA
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
===========================
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user