1
- .. _admin-upgrades :
1
+ .. _admin-upgrades :
2
2
3
3
Upgrades
4
4
========
5
5
6
6
For information about backwards compatibility,
7
7
see the :ref: `compatibility guarantees <compatibility_guarantees >` description.
8
8
9
- .. _admin-upgrades_instance :
9
+ .. _admin-upgrades_instance :
10
10
11
11
Upgrading Tarantool on a standalone instance
12
12
--------------------------------------------
@@ -16,18 +16,25 @@ Notice that this will **always imply a downtime**.
16
16
To upgrade **without downtime **, you need several Tarantool servers running in a
17
17
replication cluster (see :ref: `below <admin-upgrades_replication_cluster >`).
18
18
19
- 1. Stop the Tarantool server.
19
+ #. Stop the Tarantool server.
20
20
21
- 2. Make a copy of all data (see an appropriate hot backup procedure in
22
- :ref: `Backups <admin-backups >`) and the package from which the current (old)
23
- version was installed (for rollback purposes).
21
+ #. Make a copy of all data (see an appropriate hot backup procedure in
22
+ :ref: `Backups <admin-backups >`) and the package from which the current (old)
23
+ version was installed (for rollback purposes).
24
24
25
- 3. Update the Tarantool server. See installation instructions at Tarantool
26
- `download page <http://tarantool.org/download.html >`_.
25
+ #. Update the Tarantool server. See installation instructions at Tarantool
26
+ `download page <http://tarantool.org/download.html >`_.
27
27
28
- After that, make sure to :ref: `finish the upgrade properly <admin-upgrades_db >`.
28
+ #. Run :ref: `box.schema.upgrade() <box_schema-upgrade >` on the new master.
29
+ This will update the Tarantool system spaces to match the currently installed version of Tarantool.
30
+ There is no need to run ``box.schema.upgrade() `` on every node:
31
+ changes are propagated to other nodes via the regular replication mechanism.
29
32
30
- .. _admin-upgrades_replication_cluster :
33
+ #. Update your application files, if needed.
34
+
35
+ #. Launch the updated Tarantool server using ``tarantoolctl ``, ``tt ``, or ``systemctl ``.
36
+
37
+ .. _admin-upgrades_replication_cluster :
31
38
32
39
Upgrading Tarantool in a replica set with no downtime
33
40
-----------------------------------------------------
@@ -47,82 +54,50 @@ instructions for individual versions :ref:`in the list below <admin-upgrades_ver
47
54
Preparations
48
55
~~~~~~~~~~~~
49
56
50
- #. Check the replica set health by running the following code on every instance:
57
+ #. Check the replica set health by running the following code on every instance:
51
58
52
- .. code-block :: tarantoolsession
59
+ .. code-block :: tarantoolsession
53
60
54
- box.info.ro -- "false" at least on one instance
55
- box.info.status -- should be "running"
61
+ box.info.ro -- "false" at least on one instance
62
+ box.info.status -- should be "running"
56
63
57
- If all instances have ``box.info.ro = true ``, this means there are no writable nodes.
58
- If you're running Tarantool :doc: `v. 2.10.0 </release/2.10.0 >` or later,
59
- you can find out the reason by running ``box.info.ro_reason ``.
60
- If it has the value ``orphan ``, the instance doesn't see the rest of the replica set.
61
- Similarly, if ``box.info.status `` has the value ``orphan ``, the instance doesn't see the rest of the replica set.
62
- First resolve the replication issues and only then continue.
63
-
64
- If you're running Cartridge, you can also check node health in the UI.
65
-
66
- #. Make sure each replica connected to the rest of the replica set.
67
- Run ``box.info.replication `` and check the output table.
68
- For each instance ``id ``, there are ``upstream `` and ``downstream `` values.
69
- Both of them should have the value ``follow ``, except on the instance where you run this code.
70
- This means that the replicas are connected and there are no errors in the data flow.
71
-
72
- The value of the ``lag `` field can be less or equal than ``box.cfg.replication_timeout ``,
73
- but it can also be moderately larger.
74
- For example, if ``box.cfg.replication_timeout `` is 1 second and the write load on the master is high,
75
- it's generally OK to have a lag of about 10 seconds on the master.
76
- It is up to the user to decide what lag values are fine.
77
-
64
+ If all instances have ``box.info.ro = true ``, this means there are no writable nodes.
65
+ If you're running Tarantool :doc: `v. 2.10.0 </release/2.10.0 >` or later,
66
+ you can find out the reason by running ``box.info.ro_reason ``.
67
+ If it has the value ``orphan ``, the instance doesn't see the rest of the replica set.
68
+ Similarly, if ``box.info.status `` has the value ``orphan ``, the instance doesn't see the rest of the replica set.
69
+ First resolve the replication issues and only then continue.
70
+
71
+ If you're running Cartridge, you can also check node health in the UI.
72
+
73
+ #. Make sure each replica is connected to the rest of the replica set.
74
+ To do this, run ``box.info.replication `` in the instance's console
75
+ and check the output table for values like ``upstream ``, ``downstream ``, and ``lag ``.
76
+
77
+ For each instance ``id ``, there are ``upstream `` and ``downstream `` values.
78
+ Both of them should have the value ``follow ``, except on the instance where you run this code.
79
+ This means that the replicas are connected and there are no errors in the data flow.
80
+
81
+ The value of the ``lag `` field can be less or equal than ``box.cfg.replication_timeout ``,
82
+ but it can also be moderately larger.
83
+ For example, if ``box.cfg.replication_timeout `` is 1 second and the write load on the master is high,
84
+ it's generally OK to have a lag of about 10 seconds on the master.
85
+ It is up to the user to decide what lag values are fine.
86
+
78
87
If the replica set is healthy, proceed to the upgrade.
79
88
80
89
Upgrade procedure
81
90
~~~~~~~~~~~~~~~~~
82
91
83
92
.. include :: ./_includes/upgrade_procedure.rst
84
93
85
- After upgrading the replica set, make sure to run ``box.schema.upgrade() `` on the new master
86
- as described below in the section ":ref: `Finishing the upgrade <admin-upgrades_db >`".
87
- There is no need to run ``box.schema.upgrade() `` on every node:
88
- changes are propagated to other nodes via the regular replication mechanism.
89
-
90
- Finally, run ``box.snapshot() `` on every node in the replica set
91
- to make sure that the replicas immediately see the upgraded database state in case of restart.
92
-
93
- .. _admin-upgrades_db :
94
-
95
- Finalizing the upgrade
96
- ----------------------
97
-
98
- 1. If you created a database with an older Tarantool version and have now installed
99
- a newer version, make the request ``box.schema.upgrade() ``. This updates
100
- Tarantool system spaces to match the currently installed version of Tarantool.
101
-
102
- For example, here is what happens when you run ``box.schema.upgrade() `` with a
103
- database created with Tarantool version 1.6.4 to version 1.7.2 (only a small
104
- part of the output is shown):
105
-
106
- .. code-block :: tarantoolsession
107
-
108
- tarantool> box.schema.upgrade()
109
- alter index primary on _space set options to {"unique":true}, parts to [[0,"unsigned"]]
110
- alter space _schema set options to {}
111
- create view _vindex...
112
- grant read access to 'public' role for _vindex view
113
- set schema version to 1.7.0
114
- ---
115
- ...
116
-
117
- You can also put the request ``box.schema.upgrade() ``
118
- inside a :doc: `box.once() </reference/reference_lua/box_once >` function in your Tarantool
119
- :ref: `initialization file <index-init_label >`.
120
- On startup, this will create new system spaces, update data type names (for example,
121
- ``num `` -> ``unsigned ``, ``str `` -> ``string ``) and options in Tarantool system spaces.
122
-
123
- 2. Update your application files, if needed.
94
+ 7. Run :ref: `box.schema.upgrade() <box_schema-upgrade >` on the new master.
95
+ This will update the Tarantool system spaces to match the currently installed version of Tarantool.
96
+ There is no need to run ``box.schema.upgrade() `` on every node:
97
+ changes are propagated to other nodes via the regular replication mechanism.
124
98
125
- 3. Launch the updated Tarantool server using ``tarantoolctl ``, ``tt ``, or ``systemctl ``.
99
+ 8. Run ``box.snapshot() `` on every node in the replica set
100
+ to make sure that the replicas immediately see the upgraded database state in case of restart.
126
101
127
102
128
103
.. _admin-upgrades_version_specifics :
0 commit comments