Connect to a remote cluster
To replicate an index on a remote cluster (Cluster A) to a local cluster (Cluster B), you configure Cluster A as a remote on Cluster B.
To configure a remote cluster from Stack Management in Kibana:
- Set up a secure connection as needed.
- Select Remote Clusters from the side navigation.
- Specify the Elasticsearch endpoint URL, or the IP address or host name of the remote cluster (
ClusterA) followed by the transport port (defaults to9300). For example,cluster.es.eastus2.staging.azure.foundit.no:9400or192.168.1.1:9300.
API example
You can also use the cluster update settings API to add a remote cluster:
resp = client.cluster.put_settings(
persistent={
"cluster": {
"remote": {
"leader": {
"seeds": [
"127.0.0.1:9300"
]
}
}
}
},
)
print(resp) response = client.cluster.put_settings(
body: {
persistent: {
cluster: {
remote: {
leader: {
seeds: [
'127.0.0.1:9300'
]
}
}
}
}
}
)
puts response const response = await client.cluster.putSettings({
persistent: {
cluster: {
remote: {
leader: {
seeds: ["127.0.0.1:9300"],
},
},
},
},
});
console.log(response); PUT /_cluster/settings
{
"persistent" : {
"cluster" : {
"remote" : {
"leader" : {
"seeds" : [
"127.0.0.1:9300"
]
}
}
}
}
} | Specifies the hostname and transport port of a seed node in the remote cluster. |
You can verify that the local cluster is successfully connected to the remote cluster.
resp = client.cluster.remote_info() print(resp)
response = client.cluster.remote_info puts response
const response = await client.cluster.remoteInfo(); console.log(response);
GET /_remote/info
The API response indicates that the local cluster is connected to the remote cluster with cluster alias leader.
{
"leader" : {
"seeds" : [
"127.0.0.1:9300"
],
"connected" : true,
"num_nodes_connected" : 1,
"max_connections_per_cluster" : 3,
"initial_connect_timeout" : "30s",
"skip_unavailable" : true,
"mode" : "sniff"
}
} | The number of nodes in the remote cluster the local cluster is connected to. |
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/_connect_to_a_remote_cluster.html