@@ -101,7 +101,7 @@ promote
101
101
102
102
$ tt replicaset promote {APPLICATION:APP_INSTANCE | URI} [OPTIONS ...]
103
103
# or
104
- $ tt rs status {APPLICATION:APP_INSTANCE | URI} [OPTIONS ...]
104
+ $ tt rs promote {APPLICATION:APP_INSTANCE | URI} [OPTIONS ...]
105
105
106
106
``tt replicaset promote `` (``tt rs promote ``) promotes an instance in a Tarantool
107
107
cluster with a local YAML configuration or a Cartridge cluster.
@@ -157,7 +157,7 @@ election by calling :ref:`box_ctl-promote` on the specified instances. The
157
157
$ tt replicaset promote my-app:storage-001-a --timeout=10
158
158
159
159
160
- .. _tt-replicaset-promote-config :
160
+ .. _tt-replicaset-promote-cartridge :
161
161
162
162
Promoting in Cartridge clusters
163
163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -189,10 +189,63 @@ Learn more about `Cartridge failover modes <https://www.tarantool.io/en/doc/2.11
189
189
demote
190
190
------
191
191
192
- ``tt replicaset demote `` (``tt rs demote ``) demotes an instance.
192
+ .. code-block :: console
193
+
194
+ $ tt replicaset demote APPLICATION:APP_INSTANCE [OPTIONS ...]
195
+ # or
196
+ $ tt rs demote APPLICATION:APP_INSTANCE [OPTIONS ...]
197
+
198
+ ``tt replicaset demote `` (``tt rs demote ``) demotes an instance in a Tarantool
199
+ cluster with a local YAML configuration.
200
+
201
+ .. note ::
202
+
203
+ To demote an instance in a Tarantool cluster with a centralized configuration,
204
+ use ``tt cluster replicaset demote ``.
205
+
206
+ .. _tt-replicaset-demote-config :
207
+
208
+ Demoting in clusters with local YAML configurations
209
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
+
211
+ ``tt replicaset demote `` can demote instances in Tarantool clusters with local
212
+ YAML configurations with :ref: `failover modes <configuration_reference_replication_failover >`
213
+ ``off `` and ``election ``.
214
+
215
+ .. note ::
193
216
217
+ In clusters with ``manual `` failover mode, you can demote a read-write instance
218
+ by promoting a read-only instance from the same replica set with ``tt replicaset promote ``.
219
+
220
+ In the ``off `` failover mode, ``tt replicaset demote `` sets the configuration parameter
221
+ :ref: `configuration_reference_database_mode ` to ``ro `` for the specified instance and reloads
222
+ the configuration.
223
+
224
+ .. important ::
225
+
226
+ If failover is ``off ``, the command considers the modes of cluster instances
227
+ independently, so there can be any number of read-write instances in a replica set.
228
+
229
+ With ``-f ``/``--force `` option, ``tt replicaset demote `` skips instances not running
230
+ in the same ``tt `` environment:
231
+
232
+ .. code-block :: console
233
+
234
+ $ tt replicaset demote my-app:storage-001-a --force
235
+
236
+ In the ``election `` failover mode, ``tt replicaset demote `` does the following:
237
+
238
+ #. Checks if the specified instance is a replica set leader.
239
+ #. Sets the specified instance's:ref: `configuration_reference_replication_election_mode `
240
+ to ``voter `` and reloads the configuration.
241
+ #. After a new leader is elected and the instance is read-only, sets the instance's
242
+ ``replication.election_mode `` back to ``candidate ``.
243
+
244
+ The ``--timeout `` option can be used to specify the election completion timeout:
245
+
246
+ .. code-block :: console
194
247
195
- To demote an instance in a cluster with a centralized configuration, use `` tt cluster replicaset demote ``
248
+ $ tt replicaset demote my-app:storage-001-a --timeout=10
196
249
197
250
.. _tt-replicaset-orchestrator :
198
251
0 commit comments