1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
Prerequisites
-------------
Before you install and configure the Database service, you must create a
database, service credentials, and API endpoints.
#. To create the database, complete these steps:
* Use the database access client to connect to the database
server as the ``root`` user:
.. code-block:: console
$ mysql -u root -p
* Create the ``trove`` database:
.. code-block:: console
CREATE DATABASE trove;
* Grant proper access to the ``trove`` database:
.. code-block:: console
GRANT ALL PRIVILEGES ON trove.* TO 'trove'@'localhost' \
IDENTIFIED BY 'TROVE_DBPASS';
GRANT ALL PRIVILEGES ON trove.* TO 'trove'@'%' \
IDENTIFIED BY 'TROVE_DBPASS';
Replace ``TROVE_DBPASS`` with a suitable password.
* Exit the database access client.
#. Source the ``admin`` credentials to gain access to
admin-only CLI commands:
.. code-block:: console
$ . admin-openrc
#. To create the service credentials, complete these steps:
* Create the ``trove`` user:
.. code-block:: console
$ openstack user create --domain default --password-prompt trove
User Password:
Repeat User Password:
+-----------+-----------------------------------+
| Field | Value |
+-----------+-----------------------------------+
| domain_id | default |
| enabled | True |
| id | ca2e175b851943349be29a328cc5e360 |
| name | trove |
+-----------+-----------------------------------+
* Add the ``admin`` role to the ``trove`` user:
.. code-block:: console
$ openstack role add --project service --user trove admin
.. note::
This command provides no output.
* Create the ``trove`` service entity:
.. code-block:: console
$ openstack service create --name trove \
--description "Database" database
+-------------+-----------------------------------+
| Field | Value |
+-------------+-----------------------------------+
| description | Database |
| enabled | True |
| id | 727841c6f5df4773baa4e8a5ae7d72eb |
| name | trove |
| type | database |
+-------------+-----------------------------------+
#. Create the Database service API endpoints:
.. code-block:: console
$ openstack endpoint create --region RegionOne \
database public http://controller:8779/v1.0/%\(tenant_id\)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 3f4dab34624e4be7b000265f25049609 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 727841c6f5df4773baa4e8a5ae7d72eb |
| service_name | trove |
| service_type | database |
| url | http://controller:8779/v1.0/%\(tenant_id\)s |
+--------------+----------------------------------------------+
$ openstack endpoint create --region RegionOne \
database internal http://controller:8779/v1.0/%\(tenant_id\)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 9489f78e958e45cc85570fec7e836d98 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 727841c6f5df4773baa4e8a5ae7d72eb |
| service_name | trove |
| service_type | database |
| url | http://controller:8779/v1.0/%\(tenant_id\)s |
+--------------+----------------------------------------------+
$ openstack endpoint create --region RegionOne \
database admin http://controller:8779/v1.0/%\(tenant_id\)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 76091559514b40c6b7b38dde790efe99 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 727841c6f5df4773baa4e8a5ae7d72eb |
| service_name | trove |
| service_type | database |
| url | http://controller:8779/v1.0/%\(tenant_id\)s |
+--------------+----------------------------------------------+
|