tpaexec switchover
==================

The ``tpaexec switchover`` command performs a controlled switchover
between a primary and a replica in a :ref:`cluster that uses streaming replication <M1>`  . After you run this
command, the selected replica is promoted to be the new primary, the
former primary becomes a new replica, and any other replicas in the
cluster will be reconfigured to follow the new primary.

The command checks that the cluster is healthy before switching roles,
and is designed to be run without having to shut down any repmgr
services beforehand.

(This is equivalent to running ``repmgr standby switchover`` with the
``--siblings-follow`` option.)

Example
-------

This command will make ``replicaname`` be the new primary in
``~/clusters/speedy`` :

.. code:: bash

   $ tpaexec switchover ~/clusters/speedy replicaname

Architecture options
--------------------

This command is applicable only to :ref:`M1 clusters <M1>` 

that have a single writable primary instance and one or more read-only
replicas.

For BDR-Always-ON clusters, use the :ref:`HAProxy server pool management commands <BDR/HAProxy server pool management>`  to perform maintenance
on PGD instances.
