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) coordinating cluster 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

Remove auto-follow rules and stop affected replication on the follower cluster before deleting a CCR 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:

Deleting an auto-follow rule prevents new replication but doesn't stop replication already started by the rule. Stopping replication converts the follower index to a standard index. It doesn't delete the index, and replication can't be resumed.

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

  1. Delete each auto-follow rule that uses the alias.
    DELETE /_plugins/_replication/_autofollow
    {"leader_alias":"leader-a","name":"<rule_name>"}
  2. Stop replication for every affected follower index.
    POST /_plugins/_replication/<follower_index>/_stop
    {}
    1. Open the connecting cluster: the CCS coordinating cluster or CCR follower. 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.
      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 next to 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.
  • Remove the outbound alias, then remove an unused inbound allowance with the CLI.

    Delete a cross-cluster connection in the following order.

    1. Remove the alias from the connecting cluster: the CCS coordinating cluster or CCR follower, using oci opensearch cluster update with the revised configuration.

      Use isEnabled=true and include the complete outboundClusters list, omitting only the alias to remove. Include every connection that you want to retain. Use the current cluster display name.

      The following example starts with three 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>"
      }

      To remove remote-cluster-2 while preserving remote-cluster-1 and remote-cluster-3, save the following revised JSON to the configuration file referenced by --from-json:

      {
        "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>"
      }

      Run the command with that configuration file:

      oci opensearch cluster update \
        --opensearch-cluster-id "<connecting_cluster_ocid>" \
        --display-name "<current_cluster_display_name>" \
        --from-json "file://<config_file_name>.json" \
        --wait-for-state SUCCEEDED

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

      Note

      All three aliases in this example use the same accepting cluster. Because remote-cluster-1 and remote-cluster-3 remain, retain this connecting cluster's inbound allowance on 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. If no other alias still uses the accepting cluster, remove the unused inbound allowance from the CCS remote cluster or CCR leader using oci opensearch cluster configureoutboundcluster.

      Supply the complete list of connecting cluster OCIDs that you want to retain. Omit the removed cluster only if no other alias still uses this accepting cluster. The file supplied to --inbound-cluster-ids contains a JSON array.

      The following separate example starts with two connecting clusters in the allowed-cluster list:

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

      After all aliases from the second connecting cluster to this accepting cluster have been removed, save the following revised array to the file referenced by --inbound-cluster-ids:

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

      Run the command with that file:

      oci opensearch cluster configureoutboundcluster \
        --opensearch-cluster-id "<accepting_cluster_ocid>" \
        --inbound-cluster-ids "file://<inbound_cluster_ids_file>.json" \
        --wait-for-state SUCCEEDED

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

  • Remove the outbound alias, then remove an unused inbound allowance with the API.

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

    1. Run UpdateOpensearchCluster on the connecting cluster: the CCS coordinating cluster 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 doesn't replace the explicit disable setting.