This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Connect to a remote cluster
editConnect to a remote cluster
editTo 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:9400
or192.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" ] } } } } }
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
.