summaryrefslogtreecommitdiff
path: root/doc/source/admin/datastore.rst
blob: d98fdef4fc6dddfb3bdd8cabea689e113cafe2c1 (plain)
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
.. _database:

=========
Datastore
=========

Introduction
~~~~~~~~~~~~

A datastore is typically created as a type of database. For each datastore,
there could be multiple datastore versions. For example, for MySQL database,
Trove could support 5.7.29, 5.7.30 or 5.8.

Admin user needs to create datastore and its versions as required.

A datastore version is always associated with a Glance image, either by image
ID or image tags. If the image ID is not provided, the image can be retrieved
by the image tags. The tags are used for filtering as a whole rather than
separately. Using image tags is more flexible than ID especially when a new
guest image is uploaded to Glance, Trove can pick up the latest image
automatically for creating instances.

Create datastore version
~~~~~~~~~~~~~~~~~~~~~~~~

When creating a datastore version, Trove will create the datastore first if it
doesn't exist.

When using image tags, make sure the image with the tags exists before creating
the datastore version.

.. note::

    From Victoria release, all the datastores can be configured with a same
    Glance image but with different datastore name and version name.

To create a datastore version:

#. Create a trove guest image

   Refer to `Build images using trovestack
   <https://docs.openstack.org/trove/latest/admin/building_guest_images.html#build-images-using-trovestack>`_

#. Register image with Image service

   You need to register your guest image with the Image service as cloud admin.

   .. code-block:: console

      openstack image create \
        trove-guest-ubuntu-bionic \
        --private \
        --disk-format qcow2 --container-format bare \
        --file $image_file \
        --property hw_rng_model='virtio' \
        --tag trove --tag mysql

#. Create the datastore version

   .. code-block:: console

      openstack datastore version create 5.7.29 mysql mysql "" \
			  --image-tags trove,mysql \
				--active --default

#. Load validation rules for configuration groups

   **Background.** You can manage database configuration tasks by using
   configuration groups. Configuration groups let you set configuration
   parameters, in bulk, on one or more databases.

   When you set up a configuration group using the :command:`openstack database
   configuration create` command, this command compares the configuration
   values you are setting against a list of valid configuration values that are
   stored in the ``validation-rules.json`` file.

   .. list-table::
      :header-rows: 1
      :widths: 20 20 20

      * - Operating System
        - Location of :file:`validation-rules.json`
        - Notes

      * - Ubuntu 18.04
        - :file:`/usr/lib/python3/dist-packages/trove/templates/DATASTORE_NAME`
        - DATASTORE_NAME is the name of the datastore, e.g. ``mysql``
          or ``postgresql``.

      * - RHEL 7, CentOS 7, Fedora 20, and Fedora 21
        - :file:`/usr/lib/python3/site-packages/trove/templates/DATASTORE_NAME`
        - DATASTORE_NAME is the name of the datastore, e.g. ``mysql``
          or ``postgresql``.

   |

   Therefore, as part of creating a data store, you need to load the
   ``validation-rules.json`` file, using the :command:`trove-manage`
   :command:`db_load_datastore_config_parameters` command on trove controller
   node. This command takes the following arguments:

   * Data store name
   * Data store version
   * Full path to the ``validation-rules.json`` file

   |

   This example loads the ``validation-rules.json`` file for a MySQL
   database on Ubuntu 18.04:

   .. code-block:: console

      $ trove-manage db_load_datastore_config_parameters mysql 5.7.29 /usr/lib/python3/dist-packages/trove/templates/mysql/validation-rules.json

Hide a datastore version
~~~~~~~~~~~~~~~~~~~~~~~~

Sometimes, it's needed to make a datastore version invisible to the cloud
users, e.g when a datastore version is deprecated or creating a datastore
version for testing purpose, to do that:

   .. code-block:: console

      $ openstack datastore version <version-id> --disable