pgd raft enable
===============

Synopsis
--------

The ``pgd raft enable`` command enables the Raft consensus worker on one
or more nodes in the EDB Postgres Distributed cluster.

Enabling the worker allows the node to participate in Raft elections,
log replication, and cluster-wide state changes.

Users and roles
^^^^^^^^^^^^^^^

Requires the ``bdr_superuser`` role. See :ref:`User roles <User roles>`  .

Syntax
------

.. code:: plaintext

   pgd raft enable [OPTIONS]

Options
-------

The following options are available for the ``pgd raft enable`` command:

.. csv-table::
  :header: Short,Long,Description
  :widths: 12,10,25
  :align: left
  :class: longtable

  "",--node,Target a specific node by name to enable its Raft worker.
  "",--group,Target all nodes in a specific group.
  "",--all,Target all nodes in the cluster.

See `Global Options <https://www.enterprisedb.com/docs/pgd/latest/reference/cli/command_ref/#global-options>`_  for common global options.

Examples
--------

Enable Raft on a specific node
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

   pgd raft enable --node kaftan
   __OUTPUT__
   Raft enabled successfully on node kaftan

Enable Raft for all nodes in a group
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

   pgd raft enable --group dc1_subgroup
   __OUTPUT__
   Raft enabled successfully on 3 nodes in group dc1_subgroup

Enable Raft for the entire cluster
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

   pgd raft enable --all
   __OUTPUT__
   Raft enabled successfully on 6 nodes in the cluster
