Deleting a Cross Cluster Connection from an OpenSearch Cluster

Delete a cross cluster connection from an OpenSearch cluster.

First remove the Outbound alias from the connecting cluster: the cross-cluster search (CCS) coordinator or cross-cluster replication (CCR) follower. After its work request succeeds, remove the Inbound allowance from the accepting cluster: the CCS remote cluster or CCR leader. These changes take place on different clusters.

For the cluster roles and setup sequence, see the complete CCS and CCR setup examples.

Preparing to Remove a Replication Connection

Before removing a CCR connection, delete any auto-follow rules using the alias and stop replication for every affected follower index. Run these requests on the follower cluster:

DELETE /_plugins/_replication/_autofollow
{"leader_alias":"leader-a","name":"<rule-name>"}

POST /_plugins/_replication/<follower-index>/_stop
{}

Deleting an auto-follow rule prevents new replication but does not stop replication already started by the rule. Stopping replication converts the follower index to a standard index. It does not delete the index, and replication cannot simply be resumed.

For the operations and their effects, see Cross-cluster replication API. Select the documentation version that matches your cluster.

    1. On the Clusters list page, select the OpenSearch cluster that you want to work with. If you need help finding the list page or the cluster, see Listing Clusters.
      Open the connecting cluster: the CCS coordinating cluster or CCR follower. Its details page opens.
    2. Select Cross cluster connections.
      The Cross cluster connections section opens. All cross cluster connections are displayed in a table.
    3. Select Delete connections.
      The Delete cross cluster connections panel opens.
    4. Select Outbound.
      The outbound cross cluster connections associated with the connection type you selected are displayed.
    5. Select the X to the right of the connection you want to delete.
      A confirmation dialog box opens.
    6. When prompted, confirm the deletion.
    7. Repeat the deletion procedure for any other cross cluster connections you want to delete.
      The cluster containing the cross cluster connections you deleted goes into the Updating state while the deletions are processed.
    8. Return to the Clusters list and wait for the connecting cluster to return to Active.
    9. Open the accepting cluster: the CCS remote cluster or CCR leader. Select Cross cluster connections, then Delete connections, and select Inbound.
      The inbound cross cluster connections associated with the connection type you selected are displayed.
    10. Remove the connecting cluster's entry only if no other alias still uses this accepting cluster. Retain entries required by other connections.
    11. Select Delete.
      The cluster containing the cross cluster connections you deleted goes into the Updating state while the deletions are processed.
  • Deleting a cross cluster connection using the CLI involves the following steps:

    1. Run oci opensearch cluster update on the connecting cluster: the CCS coordinator or CCR follower. Use isEnabled=true and include the complete outboundClusters list, omitting only the alias to remove. Use the current cluster display name:
      oci opensearch cluster update --opensearch-cluster-id <connecting_cluster_ocid> --display-name "<current_cluster_display_name>" --from-json file://<config_file>.json --wait-for-state SUCCEEDED
      Include all connections to retain. The following example removes remote-cluster-2 while preserving remote-cluster-1 and remote-cluster-3.

      If your configuration initially contains the following aliases:

      {
        "outboundClusterConfig": {
          "isEnabled": true,
          "outboundClusters": [
            {
              "displayName": "remote-cluster-1",
              "isSkipUnavailable": true,
              "seedClusterId": "ocid1.opensearchcluster.oc1.iad.<accepting_cluster_unique_id>",
              "mode": "SEARCH_AND_REPLICATION"
            },
             {
              "displayName": "remote-cluster-2",
              "isSkipUnavailable": true,
              "seedClusterId": "ocid1.opensearchcluster.oc1.iad.<accepting_cluster_unique_id>",
              "mode": "SEARCH_AND_REPLICATION"
            },
             {
              "displayName": "remote-cluster-3",
              "isSkipUnavailable": true,
              "seedClusterId": "ocid1.opensearchcluster.oc1.iad.<accepting_cluster_unique_id>",
              "mode": "SEARCH_AND_REPLICATION"
            }  
          ]
        },
      "opensearchClusterId": "ocid1.opensearchcluster.oc1.iad.<connecting_cluster_unique_id>"
      }

      after running the oci opensearch cluster update command to remove remote-cluster-2, it would be updated to the following:

      {
        "outboundClusterConfig": {
          "isEnabled": true,
          "outboundClusters": [
            {
              "displayName": "remote-cluster-1",
              "isSkipUnavailable": true,
              "seedClusterId": "ocid1.opensearchcluster.oc1.iad.<accepting_cluster_unique_id>",
              "mode": "SEARCH_AND_REPLICATION"
            },
             {
              "displayName": "remote-cluster-3",
              "isSkipUnavailable": true,
              "seedClusterId": "ocid1.opensearchcluster.oc1.iad.<accepting_cluster_unique_id>",
              "mode": "SEARCH_AND_REPLICATION"
            }  
          ]
        },
      "opensearchClusterId": "ocid1.opensearchcluster.oc1.iad.<connecting_cluster_unique_id>"
      }

      where remote-cluster-2 is no longer present. This operation preserves the connections you want and deletes only the omitted one.

      Wait for the work request to succeed and the connecting cluster to return to Active before changing the accepting cluster.
      Note

      Setting isEnabled=false on the connecting cluster disables all configured aliases and removes them; they aren’t retained for later reactivation. Stop affected cross-cluster replication jobs before disabling.
    2. Run oci opensearch cluster configureoutboundcluster on the accepting cluster: the CCS remote cluster or CCR leader. Supply the complete list of connecting cluster OCIDs to retain. Omit the removed cluster only if no other alias still uses the same accepting cluster. The file supplied to --inbound-cluster-ids contains a JSON array:
      oci opensearch cluster configureoutboundcluster --opensearch-cluster-id <accepting_cluster_ocid> --inbound-cluster-ids file://<inbound_clusterIDs_file>.json --wait-for-state SUCCEEDED

      If your allowed-cluster list initially contains the following OCIDs:

      [
        "ocid1.opensearchcluster.oc1.iad.<connecting_cluster1_unique_id>",
        "ocid1.opensearchcluster.oc1.iad.<connecting_cluster2_unique_id>"
      ]

      After running the oci opensearch cluster configureoutboundcluster command to pass the complete list of inbound cluster IDs, it would be updated to the following:

      [
        "ocid1.opensearchcluster.oc1.iad.<connecting_cluster1_unique_id>"
      ]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Remove a cross-cluster connection using the API in this order:

    1. Run UpdateOpensearchCluster on the connecting cluster: the CCS coordinator or CCR follower. Set isEnabled=true and supply the complete outboundClusters list, omitting only the alias to remove. Wait for the work request to succeed and the cluster to return to Active.

    2. Run ConfigureOutboundCluster on the accepting cluster: the CCS remote cluster or CCR leader. Supply the complete inboundClusterIds list to retain. Remove the connecting cluster OCID only if no other alias still uses this accepting cluster.

    To disable all aliases on the connecting cluster, set isEnabled=false and omit outboundClusters, set it to null, or pass an empty list. A nonempty list returns InvalidParameter (HTTP 400). An empty list alone does not replace the explicit disable setting. See Disabling Cross-Cluster Connections.