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.
Deleting a cross cluster connection using the CLI involves the following steps:
- 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:Include all connections to retain. The following example removes remote-cluster-2 while preserving remote-cluster-1 and remote-cluster-3.
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 SUCCEEDEDIf 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 updatecommand to removeremote-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-2is 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
SettingisEnabled=falseon 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. - 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 SUCCEEDEDIf 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 configureoutboundclustercommand 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.
- 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:
Remove a cross-cluster connection using the API in this order:
-
Run UpdateOpensearchCluster on the connecting cluster: the CCS coordinator or CCR follower. Set
isEnabled=trueand supply the completeoutboundClusterslist, omitting only the alias to remove. Wait for the work request to succeed and the cluster to return to Active. -
Run ConfigureOutboundCluster on the accepting cluster: the CCS remote cluster or CCR leader. Supply the complete
inboundClusterIdslist 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=falseand omitoutboundClusters, set it tonull, or pass an empty list. A nonempty list returnsInvalidParameter(HTTP 400). An empty list alone does not replace the explicit disable setting. See Disabling Cross-Cluster Connections.-