Manage cluster peering connections
This usage topic describes how to manage cluster peering connections using the CLI, the HTTP API, and the UI.
After you establish a cluster peering connection, you can get a list of all active peering connections, read a specific peering connection's information, and delete peering connections.
For Kubernetes-specific guidance for managing cluster peering connections, refer to Manage cluster peering connections on Kubernetes.
List all peering connections
You can list all active peering connections in a cluster.
$ consul peering listName State Imported Svcs Exported Svcs Metacluster-02 ACTIVE 0 2 env=productioncluster-03 PENDING 0 0
For more information, including optional flags and parameters, refer to the consul peering list
CLI command reference.
Read a peering connection
You can get information about individual peering connections between clusters.
The following example outputs information about a peering connection locally referred to as "cluster-02":
$ consul peering read -name cluster-02Name: cluster-02ID: 3b001063-8079-b1a6-764c-738af5a39a97State: ACTIVEMeta: env=production Peer ID: e83a315c-027e-bcb1-7c0c-a46650904a05Peer Server Name: server.dc1.consulPeer CA Pems: 0Peer Server Addresses: 10.0.0.1:8300 Imported Services: 0Exported Services: 2 Create Index: 89Modify Index: 89
For more information, including optional flags and parameters, refer to the consul peering read
CLI command reference.
Delete peering connections
You can disconnect the peered clusters by deleting their connection. Deleting a peering connection stops data replication to the peer and deletes imported data, including services and CA certificates.
The following examples deletes a peering connection to a cluster locally referred to as "cluster-02":
$ consul peering delete -name cluster-02Successfully submitted peering connection, cluster-02, for deletion
For more information, including optional flags and parameters, refer to the consul peering delete
CLI command reference.