Enable cross cluster search

edit

Cross cluster search is a RESTful API-only feature that allows you to search across multiple Elasticsearch clusters with a single query. To run queries against other clusters using cross cluster search, you can configure existing Elasticsearch clusters.

Cluster settings are automatically maintained and updated when cluster topologies change. For example, all connected clusters are updated when:

  • A cluster is deleted
  • A node is added or removed from a cluster
  • An IP address changes

Before you begin

edit

To enable cross cluster search, you must meet the following criteria.

  • To access the RESTful API for Elastic Cloud Enterprise, you must use your Elastic Cloud Enterprise credentials.
  • All clusters must be in the same region and owned by the same user.
  • All Elasticsearch clusters must be version 6.0 or later.

For more information about cross cluster search in Elasticsearch, refer to the Elasticsearch documentation.

Steps

edit

Enable cross cluster search on your cluster:

curl -k -X PUT -u USER:PASSWORD https://COORDINATOR_HOST:12443/api/v1/clusters/elasticsearch/ELASTICSEARCH_CLUSTER_ID/ccs/settings \
{
   "remote_clusters": {
   "alias1<5>": {
      "cluster_id": "fbbc90c8540843adaa4304b4a5cf9eba",
      "skip_unavailable": true
    },
    "alias2": {
      "cluster_id": "4e8c2d90e94b4a1a9a9b2c83145a8df1",
      "skip_unavailable": false
    }
  }
}
ELASTICSEARCH_CLUSTER_ID
The Elasticsearch cluster ID as shown in the Cloud UI or obtained via the API

Cluster aliases must contain only letters, numbers, dashes (-), or underscores (_)

To learn about skipping disconnected clusters, refer to the Elasticsearch documentation.

When cross cluster search is already configured on a cluster, the PUT request replaces the existing configuration with the new settings.

Other cross cluster search settings exposed by Elasticsearch are managed by Elastic Cloud Enterprise. Do not change these settings.

Retrieve cross cluster search configurations:

curl -k -X PUT -u $USER:$PASSWORD https://$COORDINATOR_HOST:12443/api/v1/clusters/elasticsearch/$ELASTICSEARCH_CLUSTER_ID/ccs/settings