# Connecting to cluster for querying?

**URL:** https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346
**Category:** Elasticsearch
**Created:** [September 18, 2010, 6:46pm UTC](https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346 "2010-09-18T18:46:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei/32/2856_2.png) [@Andrei](https://discuss.elastic.co/u/Andrei)
#### Post date: [September 18, 2010, 6:46pm UTC](https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346/1 "2010-09-18T18:46:00Z")

</div>

If I run a cluster of ElasticSearch nodes, can I connect to any node  
in order to issue a query? How should I deal with failover if that  
node is down - move onto the next one in the node list?

-Andrei

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [September 18, 2010, 6:50pm UTC](https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346/2 "2010-09-18T18:50:19Z")

</div>

Yes, you can issue a query to any node, and it will execute it, if a node  
fails, you can move to the next node. The cluster state API returns for all  
the nodes the addresses it exposes, so you can build dynamic round robin /  
failover (thats what the perl client does).

-shay.banon

On Sat, Sep 18, 2010 at 8:46 PM, Andrei [andrei@zmievski.org](mailto:andrei@zmievski.org) wrote:

> If I run a cluster of Elasticsearch nodes, can I connect to any node  
> in order to issue a query? How should I deal with failover if that  
> node is down - move onto the next one in the node list?
> 
> -Andrei

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei/32/2856_2.png) [@Andrei](https://discuss.elastic.co/u/Andrei)
#### Post date: [September 18, 2010, 6:58pm UTC](https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346/3 "2010-09-18T18:58:46Z")

</div>

Right, though have to find a healthy node first to issue the cluster  
health  
query against. 🙂

-Andrei

On Sep 18, 2:50 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Yes, you can issue a query to any node, and it will execute it, if a node  
> fails, you can move to the next node. The cluster state API returns for all  
> the nodes the addresses it exposes, so you can build dynamic round robin /  
> failover (thats what the perl client does).
> 
> -shay.banon

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [September 18, 2010, 7:04pm UTC](https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346/4 "2010-09-18T19:04:28Z")

</div>

Yes, though you can create a list of all the nodes when things are good, so  
you know who to fall over to.

On Sat, Sep 18, 2010 at 8:58 PM, Andrei [andrei@zmievski.org](mailto:andrei@zmievski.org) wrote:

> Right, though have to find a healthy node first to issue the cluster  
> health  
> query against. 🙂
> 
> -Andrei
> 
> On Sep 18, 2:50 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Yes, you can issue a query to any node, and it will execute it, if a node  
> > fails, you can move to the next node. The cluster state API returns for  
> > all  
> > the nodes the addresses it exposes, so you can build dynamic round robin  
> > /  
> > failover (thats what the perl client does).
> > 
> > -shay.banon

---

<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: [July 6, 2017, 4:19am UTC](https://discuss.elastic.co/t/connecting-to-cluster-for-querying/3346/5 "2017-07-06T04:19:12Z")

</div>


