summaryrefslogtreecommitdiff
path: root/doc/source/user/upgrade-datastore.rst
blob: cceff6d2e3c24270813d46498dbcb55af6e0f4bc (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
=================
Upgrade datastore
=================

You can upgrade the datastore version of the database instance. When you
perform an upgrade, the system automatically manages data and
configuration files of your database.

To perform datastore upgrade, you need:

- A Trove database instance to be upgrade.
- A guest image with the target datastore version.

This guide shows you how to upgrade MySQL datastore from 5.7.29 to 5.7.30 for a
database instance.

.. warning::

   Datastore upgrade could cause downtime of the database service.

Upgrading datastore
~~~~~~~~~~~~~~~~~~~

#. **Check datastore versions in the system**

   In my environment, both datastore version 5.7.29 and 5.7.30 are defined for
   MySQL.

   .. code-block:: console

      $ openstack datastore list
      +--------------------------------------+-------+
      | ID                                   | Name  |
      +--------------------------------------+-------+
      | 50bed39d-6788-4a0d-8d74-321012bb6b55 | mysql |
      +--------------------------------------+-------+
      $ openstack datastore version list mysql
      +--------------------------------------+--------+---------+
      | ID                                   | Name   | Version |
      +--------------------------------------+--------+---------+
      | 70c68d0a-27e1-4fbd-bd3b-f29d42ce1a7d | 5.7.29 | 5.7.29  |
      | cf91aa9a-2192-4ec4-b7ce-5cac3b1e7dbe | 5.7.30 | 5.7.30  |
      +--------------------------------------+--------+---------+

#. **Create a new instance with datastore version 5.7.29**

   Make sure the instance status is HEALTHY before upgrading.

   .. code-block:: console

      $ openstack database instance create test-mysql-upgrade \
        --flavor d2 \
        --size 1 \
        --nic net-id=$netid \
        --datastore mysql --datastore-version 5.7.29 \
        --databases testdb --users user:password
      $ openstack database instance list
      +--------------------------------------+--------------------+-----------+-------------------+--------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      | ID                                   | Name               | Datastore | Datastore Version | Status | Operating Status | Addresses                                     | Flavor ID | Size | Region    | Role    |
      +--------------------------------------+--------------------+-----------+-------------------+--------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      | 32eb56b0-d10d-43e9-b59e-1e4b0979e5dd | test-mysql-upgrade | mysql     | 5.7.29            | ACTIVE | HEALTHY          | [{'address': '10.0.0.54', 'type': 'private'}] | d2        |    1 | RegionOne |         |
      +--------------------------------------+--------------------+-----------+-------------------+--------+------------------+-----------------------------------------------+-----------+------+-----------+---------+

   Check the MySQL version by connecting with the database:

   .. code-block:: console

      $ ip=10.0.0.54
      $ mysql -u user -ppassword -h $ip testdb
      mysql> SELECT @@GLOBAL.innodb_version;
      +-------------------------+
      | @@GLOBAL.innodb_version |
      +-------------------------+
      | 5.7.29                  |
      +-------------------------+

#. **Run upgrade**

   Use :command:`openstack database instance upgrade` command to upgrade the
   datastore of the instance.

   .. code-block:: console

      $ openstack database instance upgrade 32eb56b0-d10d-43e9-b59e-1e4b0979e5dd cf91aa9a-2192-4ec4-b7ce-5cac3b1e7dbe

#. **Wait until status changes from UPGRADE to HEALTHY**

   Use :command:`openstack database instance list` to check the
   current status.

   .. code-block:: console

      $ openstack database instance list
      +--------------------------------------+--------------------+-----------+-------------------+---------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      | ID                                   | Name               | Datastore | Datastore Version | Status  | Operating Status | Addresses                                     | Flavor ID | Size | Region    | Role    |
      +--------------------------------------+--------------------+-----------+-------------------+---------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      | 32eb56b0-d10d-43e9-b59e-1e4b0979e5dd | test-mysql-upgrade | mysql     | 5.7.30            | UPGRADE |                  | [{'address': '10.0.0.54', 'type': 'private'}] | d2        |    1 | RegionOne |         |
      +--------------------------------------+--------------------+-----------+-------------------+---------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      $ openstack database instance list
      +--------------------------------------+--------------------+-----------+-------------------+--------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      | ID                                   | Name               | Datastore | Datastore Version | Status | Operating Status | Addresses                                     | Flavor ID | Size | Region    | Role    |
      +--------------------------------------+--------------------+-----------+-------------------+--------+------------------+-----------------------------------------------+-----------+------+-----------+---------+
      | 32eb56b0-d10d-43e9-b59e-1e4b0979e5dd | test-mysql-upgrade | mysql     | 5.7.30            | ACTIVE | HEALTHY          | [{'address': '10.0.0.54', 'type': 'private'}] | d2        |    1 | RegionOne |         |
      +--------------------------------------+--------------------+-----------+-------------------+--------+------------------+-----------------------------------------------+-----------+------+-----------+---------+

   Check the MySQL version again:

   .. code-block:: console

      $ mysql -u user -ppassword -h $ip testdb
      mysql> SELECT @@GLOBAL.innodb_version;
      +-------------------------+
      | @@GLOBAL.innodb_version |
      +-------------------------+
      | 5.7.30                  |
      +-------------------------+