# Connect to remote cluster

**URL:** <https://discuss.elastic.co/t/connect-to-remote-cluster/320952>\
**Category:** Elasticsearch\
**Tags:** ccs-cross-cluster-search\
**Created:** [December 10, 2022, 5:46pm UTC](https://discuss.elastic.co/t/connect-to-remote-cluster/320952 "2022-12-10T17:46:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheroufa](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Cheroufa](https://discuss.elastic.co/u/Cheroufa)\
**Post date:** [December 10, 2022, 5:46pm UTC](https://discuss.elastic.co/t/connect-to-remote-cluster/320952/1 "2022-12-10T17:46:14Z")

</div>

hi guys

i want to connect two clusters elasticsearch for cross search

this is my query :

PUT /\_cluster/settings  
{  
"persistent" : {  
"cluster" : {  
"remote" : {  
"c2" : {  
"seeds" : [  
"\*\*\*\*\*\*\*\*\*\*\*\*\*.westeurope.azure.elastic-cloud.com:9300"  
]  
}  
}  
}  
}  
}

but when i execute a query search :

GET c2:remote-index-test/\_search

i have this error :

{  
"error": {  
"root\_cause": [  
{  
"type": "transport\_exception",  
"reason": "handshake failed because connection reset"  
}  
],  
"type": "connect\_transport\_exception",  
"reason": "[2._._.\*:9300] general node connection failure",  
"caused\_by": {  
"type": "transport\_exception",  
"reason": "handshake failed because connection reset"  
}  
},  
"status": 500  
}

i think it's a problem of authentication so can some one help me to add basic athentication to configuration or to query please ?

thank you

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 11, 2022, 11:35am UTC](https://discuss.elastic.co/t/connect-to-remote-cluster/320952/2 "2022-12-11T11:35:05Z")

</div>

Have you looked at [the documentation](https://www.elastic.co/guide/en/cloud/current/ec-enable-ccs.html) related to setting this up on Elastic Cloud?

---

<div class="post-metadata">

**Author:** ![Rajsekhar\_Haldar1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajsekhar_haldar1/32/114460_2.png) [@Rajsekhar\_Haldar1](https://discuss.elastic.co/u/Rajsekhar_Haldar1)\
**Post date:** [December 12, 2022, 5:23am UTC](https://discuss.elastic.co/t/connect-to-remote-cluster/320952/3 "2022-12-12T05:23:26Z")

</div>

Hi @Cheroufa please ensure you are using same CA for both the clusters if you have enabled TLS/SSL layer security and if you have deployed the clusters on prem, but, if you have used elastic cloud to deploy both the cluster then all you need to ensure that the other cluster is active when you are trying to connect and instead of using query DSL you can use Kibana to connect remote cluster.

Please ensure that the clusters trust each other here is the documentation for it- [Link](https://www.elastic.co/guide/en/cloud/current/ec-trust-management.html#ec-trust-management)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 9, 2023, 5:23am UTC](https://discuss.elastic.co/t/connect-to-remote-cluster/320952/4 "2023-01-09T05:23:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
