===========
Node groups
===========

**Node groups** allow you to leverage certain aspects of configuration across
multiple nodes at once.

.. graphviz::

    graph {
        newrank=true;
        splines=false;
        nodesep=0;
        ranksep=1;
        bgcolor="transparent";
        compound=true;

        node [
            shape=box,
            style="filled,rounded",
            fillcolor="#E9F7EF",
            color="#1E8449",
            fontname="Arial",
            fontsize=12
        ];

        edge [
            style=solid,
            penwidth=1.5,
            fontname="Arial",
            fontsize=10,
            labeldistance=2.25,
            labelangle=65
        ];

        subgraph cluster_west {
            label="Group: West";
            style="filled,rounded";
            penwidth=1.5;
            fillcolor="#EAECEE";
            color="#B3B6B7";
            fontname="Arial";

            west1 [label="Node: West1"];
            west_anchor [shape=point, width=0, style=invis];
            west2 [label="Node: West2"];

            west1 -- west_anchor -- west2 [style=invis, weight=100];
        }

        subgraph cluster_east {
            label="Group: East";
            style="filled,rounded";
            penwidth=1.5;
            fillcolor="#EAECEE";
            color="#B3B6B7";
            fontname="Arial";

            east1 [label="Node: East1"];
            east_anchor [shape=point, width=0, style=invis];
            east2 [label="Node: East2"];

            east1 -- east_anchor -- east2 [style=invis, weight=100];
        }

        alpha [label="Node: Alpha"];
        beta [label="Node: Beta"];

        west_anchor -- alpha [ltail=cluster_west];
        east_anchor -- alpha [ltail=cluster_east, constraint=false];
        alpha:e -- beta:w [constraint=false];
        west_anchor -- beta [ltail=cluster_west, constraint=false];
        east_anchor -- beta [ltail=cluster_east];

        { rank=same; west1; west_anchor; west2; east1; east_anchor; east2; }
        { rank=same; alpha; beta; }
    }

|

The most common use case for groups is to set one as the remote for a peer.
While the peer will choose only one of the nodes in the group to send traffic
over, a connection will be maintained with the other nodes to facilitate quick
and seamless failover.

A given node can be a part of as many groups as desired. This allows for
flexibility and redundancy when defining node groups. Furthermore, access rules
can be defined on a node group basis.

An example of a possible peer implementation involving node groups can be found
in the `peer example topologies documentation
<../peers/example-topologies.html#full-mesh-with-groups>`__.

More information on configuring access rules on node groups can be found in the
`access rules documentation <../access-rules/index.html>`__.

.. toctree::
    :glob:
    :maxdepth: 1

    listing-node-groups
    adding-editing-and-deleting-node-groups