Ubuntu 20.04
Sponsored Link

OpenStack Victoria : Configure Trove (Control Node)2020/10/27

 
Install OpenStack Database Service (Trove).
This example is based on the environment like follows.
Install Trove services on Network Node.
------------+---------------------------+---------------------------+------------
            |                           |                           |
        eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Network Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Linux Bridge     |   |        Libvirt        |
|  Memcached  httpd     |   |   L2 Agent L3 Agent   |   |     Nova Compute      |
|  Keystone   Glance    |   |     Metadata Agent    |   |      Linux Bridge     |
|  Nova API  Cinder API |   |     Cinder Volume     |   |        L2 Agent       |
|  Neutron Server       |   |        Heat API       |   |                       |
|  Metadata Agent       |   |      Heat Engine      |   |                       |
|                       |   |    Trove Services     |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

[1] Add users and others for Trove in Keystone.
# create [trove] user in [service] project

root@dlp ~(keystone)#
openstack user create --domain default --project service --password servicepassword trove

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 37197271a1954ddb90207a95d5f46488 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | cbd24f4d834648c2abd25e0aeb3caf5b |
| name                | trove                            |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# add [trove] user in [admin] role

root@dlp ~(keystone)#
openstack role add --project service --user trove admin
# create service entry for [trove]

root@dlp ~(keystone)#
openstack service create --name trove --description "OpenStack Database Service" database

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Database Service       |
| enabled     | True                             |
| id          | a7195ba333fc482ab60c3c7fe55e8303 |
| name        | trove                            |
| type        | database                         |
+-------------+----------------------------------+

# define Trove API Host

root@dlp ~(keystone)#
export trove_api=10.0.0.50
# create endpoint for [trove] (public)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne database public http://$trove_api:8779/v1.0/%\(tenant_id\)s

+--------------+------------------------------------------+
| Field        | Value                                    |
+--------------+------------------------------------------+
| enabled      | True                                     |
| id           | f08f2fb640bd4322a1e00ce1c4e9038f         |
| interface    | public                                   |
| region       | RegionOne                                |
| region_id    | RegionOne                                |
| service_id   | a7195ba333fc482ab60c3c7fe55e8303         |
| service_name | trove                                    |
| service_type | database                                 |
| url          | http://10.0.0.50:8779/v1.0/%(tenant_id)s |
+--------------+------------------------------------------+

# create endpoint for [trove] (internal)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne database internal http://$trove_api:8779/v1.0/%\(tenant_id\)s

+--------------+------------------------------------------+
| Field        | Value                                    |
+--------------+------------------------------------------+
| enabled      | True                                     |
| id           | 0f0ae724744c4da592fa7ebf6785f00c         |
| interface    | internal                                 |
| region       | RegionOne                                |
| region_id    | RegionOne                                |
| service_id   | a7195ba333fc482ab60c3c7fe55e8303         |
| service_name | trove                                    |
| service_type | database                                 |
| url          | http://10.0.0.50:8779/v1.0/%(tenant_id)s |
+--------------+------------------------------------------+

# create endpoint for [trove] (admin)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne database admin http://$trove_api:8779/v1.0/%\(tenant_id\)s

+--------------+------------------------------------------+
| Field        | Value                                    |
+--------------+------------------------------------------+
| enabled      | True                                     |
| id           | a43f3e69fb22435b9cd4912c30e6ed85         |
| interface    | admin                                    |
| region       | RegionOne                                |
| region_id    | RegionOne                                |
| service_id   | a7195ba333fc482ab60c3c7fe55e8303         |
| service_name | trove                                    |
| service_type | database                                 |
| url          | http://10.0.0.50:8779/v1.0/%(tenant_id)s |
+--------------+------------------------------------------+
[2] Add a User and Database on MariaDB for Trove.
root@dlp ~(keystone)#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1137
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database trove; 
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on trove.* to trove@'localhost' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on trove.* to trove@'%' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit 
Bye
Matched Content