Skip to content

Commit 292b263

Browse files
committed
Add tt replicaset demote reference
1 parent b48ba3b commit 292b263

File tree

1 file changed

+57
-4
lines changed

1 file changed

+57
-4
lines changed

doc/reference/tooling/tt_cli/replicaset.rst

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ promote
101101
102102
$ tt replicaset promote {APPLICATION:APP_INSTANCE | URI} [OPTIONS ...]
103103
# or
104-
$ tt rs status {APPLICATION:APP_INSTANCE | URI} [OPTIONS ...]
104+
$ tt rs promote {APPLICATION:APP_INSTANCE | URI} [OPTIONS ...]
105105
106106
``tt replicaset promote`` (``tt rs promote``) promotes an instance in a Tarantool
107107
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
157157
$ tt replicaset promote my-app:storage-001-a --timeout=10
158158
159159
160-
.. _tt-replicaset-promote-config:
160+
.. _tt-replicaset-promote-cartridge:
161161

162162
Promoting in Cartridge clusters
163163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -189,10 +189,63 @@ Learn more about `Cartridge failover modes <https://www.tarantool.io/en/doc/2.11
189189
demote
190190
------
191191

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

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
194247
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
196249
197250
.. _tt-replicaset-orchestrator:
198251

0 commit comments

Comments
 (0)