# Is it possible to redirect the request from one server to another?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374>\
**Category:** Elasticsearch\
**Created:** [July 10, 2012, 9:35am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374 "2012-07-10T09:35:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [July 10, 2012, 9:35am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/1 "2012-07-10T09:35:23Z")

</div>

Here is a problem , I have 3 ES nodes running , if one ES node gets down  
can we serve request from other ES nodes automatically .

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 10, 2012, 9:38am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/2 "2012-07-10T09:38:38Z")

</div>

If you use Java Client it will redirect for you.  
If not, you have to add a Proxy layer on top of your nodes (NGinx, ...).

HTH

Le 10 juillet 2012 à 11:35, jajoria abhishek [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) a  
écrit :

> Here is a problem , I have 3 ES nodes running , if one ES node gets down can  
> we serve request from other ES nodes automatically .

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [July 10, 2012, 10:26am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/3 "2012-07-10T10:26:31Z")

</div>

Is it possible in query to send the request to more than two server?

On Tue, Jul 10, 2012 at 3:08 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> \*\*
> 
> If you use Java Client it will redirect for you.
> 
> If not, you have to add a Proxy layer on top of your nodes (NGinx, ...).
> 
> HTH
> 
> Le 10 juillet 2012 à 11:35, jajoria abhishek [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)  
> a écrit :
> 
> Here is a problem , I have 3 ES nodes running , if one ES node gets down  
> can we serve request from other ES nodes automatically .
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [July 10, 2012, 10:35am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/4 "2012-07-10T10:35:01Z")

</div>

Hi,

typically query gets executed on more servers (where index or relevant  
shards are located) and aggregated on a single server and sent back to the  
client. So the query is distributed automatically behind the scene.

Which server receives your query does not matter much (in most cases). Good  
elasticsearch clients can check for running nodes in the cluster  
periodically and notice if some nodes go away or are added into the  
cluster. For example Java clients does that

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Regards,  
Lukas

On Tue, Jul 10, 2012 at 12:26 PM, jajoria abhishek \<  
[jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)\> wrote:

> Is it possible in query to send the request to more than two server?
> 
> On Tue, Jul 10, 2012 at 3:08 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > \*\*
> > 
> > If you use Java Client it will redirect for you.
> > 
> > If not, you have to add a Proxy layer on top of your nodes (NGinx, ...).
> > 
> > HTH
> > 
> > Le 10 juillet 2012 à 11:35, jajoria abhishek [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)  
> > a écrit :
> > 
> > Here is a problem , I have 3 ES nodes running , if one ES node gets  
> > down can we serve request from other ES nodes automatically .
> > 
> > --  
> > David Pilato  
> > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [July 10, 2012, 11:27am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/5 "2012-07-10T11:27:13Z")

</div>

I want to explain a more here I wanted to say that suppose one server is  
down in a cluster and we are sending request request through  
[http://192.168.5.169:9200/raftaarsongs\_sdi/\_search](http://192.168.5.169:9200/raftaarsongs_sdi/_search) but I want that as  
other nodes are running the request can be serve from other nodes We are  
not using java client here is there any other way

On Tue, Jul 10, 2012 at 4:05 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Hi,
> 
> typically query gets executed on more servers (where index or relevant  
> shards are located) and aggregated on a single server and sent back to the  
> client. So the query is distributed automatically behind the scene.
> 
> Which server receives your query does not matter much (in most cases).  
> Good elasticsearch clients can check for running nodes in the cluster  
> periodically and notice if some nodes go away or are added into the  
> cluster. For example Java clients does that  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> 
> Regards,  
> Lukas
> 
> On Tue, Jul 10, 2012 at 12:26 PM, jajoria abhishek \<  
> [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)\> wrote:
> 
> > Is it possible in query to send the request to more than two server?
> > 
> > On Tue, Jul 10, 2012 at 3:08 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > \*\*
> > > 
> > > If you use Java Client it will redirect for you.
> > > 
> > > If not, you have to add a Proxy layer on top of your nodes (NGinx, ...).
> > > 
> > > HTH
> > > 
> > > Le 10 juillet 2012 à 11:35, jajoria abhishek [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)  
> > > a écrit :
> > > 
> > > Here is a problem , I have 3 ES nodes running , if one ES node gets  
> > > down can we serve request from other ES nodes automatically .
> > > 
> > > --  
> > > David Pilato  
> > > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > > Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 10, 2012, 12:51pm UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/6 "2012-07-10T12:51:38Z")

</div>

If your server is down, nobody will listen on 192.168.5.169 port 9200. So, who  
can redirect you ?  
So, as Lukas said, if you use another client than the official Java client,  
check that it supports also failover.

If you are using CURL or your own implementation of HTTP GET/POST/..., you have  
to manage the failover on your side or to add a NGinx (or any proxy) on top of  
your ES nodes.

David.

Le 10 juillet 2012 à 13:27, jajoria abhishek [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) a  
écrit :

> I want to explain a more here I wanted to say that suppose one server is down  
> in a cluster and we are sending request request through  
> [http://192.168.5.169:9200/raftaarsongs\_sdi/\_search](http://192.168.5.169:9200/raftaarsongs_sdi/_search)  
> [http://192.168.5.169:9200/raftaarsongs\_sdi/\_search](http://192.168.5.169:9200/raftaarsongs_sdi/_search) but I want that as  
> other nodes are running the request can be serve from other nodes We are not  
> using java client here is there any other way
> 
> On Tue, Jul 10, 2012 at 4:05 PM, Lukáš Vlček \<[lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)  
> [mailto:lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) \> wrote:
> 
> > > Hi,
> > 
> > typically query gets executed on more servers (where index or relevant  
> > shards are located) and aggregated on a single server and sent back to the  
> > client. So the query is distributed automatically behind the scene.
> > 
> > Which server receives your query does not matter much (in most cases).  
> > Good elasticsearch clients can check for running nodes in the cluster  
> > periodically and notice if some nodes go away or are added into the cluster.  
> > For example Java clients does that  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)  
> > [http://www.elasticsearch.org/guide/reference/java-api/client.html](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> > 
> > Regards,  
> > Lukas
> > 
> > On Tue, Jul 10, 2012 at 12:26 PM, jajoria abhishek  
> > \<[jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) [mailto:jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) \> wrote:  
> > \> \> \> Is it possible in query to send the request to more than two  
> > \> \> \> server?
> > 
> > > ```
> > > On Tue, Jul 10, 2012 at 3:08 PM, David Pilato <david@pilato.fr
> > > 
> > > ```
> > > 
> > > [mailto:david@pilato.fr](mailto:david@pilato.fr) \> wrote:  
> > > \> \> \> \> If you use Java Client it will redirect for you.
> > > 
> > > > ```
> > > > If not, you have to add a Proxy layer on top of your nodes
> > > > 
> > > > ```
> > > > 
> > > > (NGinx, ...).
> > > > 
> > > > ```
> > > > HTH
> > > > 
> > > > Le 10 juillet 2012 à 11:35, jajoria abhishek <
> > > > 
> > > > ```
> > > > 
> > > > [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) [mailto:jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) \> a écrit  
> > > > :
> > > > 
> > > > ```
> > > > > > > > > Here is a problem , I have 3 ES nodes running , if one
> > > > > > > > > ES node gets down can we serve request from other ES
> > > > > > > > > nodes automatically .
> > > > 
> > > > ```
> > > > 
> > > > > ```
> > > > > > > > > 
> > > > > 
> > > > > ```
> > > > 
> > > > ```
> > > > --
> > > > David Pilato
> > > > http://dev.david.pilato.fr/ <http://dev.david.pilato.fr/>
> > > > Twitter : @dadoonet
> > > > 
> > > > > > > > > > 
> > > > 
> > > > ```

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<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, 3:20am UTC](https://discuss.elastic.co/t/is-it-possible-to-redirect-the-request-from-one-server-to-another/8374/7 "2017-07-06T03:20:44Z")

</div>


