Files
trove/doc/source/admin/datastore.rst
Lingxian Kong 1d24b65052 Image tags support in datastore version
Change-Id: I0e51d08515c121e3a7b0e82b6e4c4161bb4fbc4a
2020-10-09 11:43:48 +13:00

4.0 KiB

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:

  1. Create a trove guest image

    Refer to Build images using trovestack

  2. Register image with Image service

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

    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
  3. Create the datastore version

    openstack datastore version create 5.7.29 mysql mysql "" \
            --image-tags trove,mysql \
              --active --default
  4. 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 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.

    Operating System Location of validation-rules.json Notes
    Ubuntu 18.04 /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 /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 trove-manage 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:

    $ 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:

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