# Load balancing ElasticSearch with virtual ip?

**URL:** <https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897>\
**Category:** Elasticsearch\
**Created:** [July 23, 2013, 11:32am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897 "2013-07-23T11:32:07Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tommy\_Albinsson](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@Tommy\_Albinsson](https://discuss.elastic.co/u/Tommy_Albinsson)\
**Post date:** [July 23, 2013, 11:32am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/1 "2013-07-23T11:32:07Z")

</div>

Hi,

I am setting up a new environment with ElasticSearch, and the out of the  
box zen discovery makes it real easy to load balance.

But if I want to set up my environment like the following.

Three servers running on the same network, works perfectly and they find  
each other.

es1 10.2.88.21  
es2 10.2.88.22  
es3 10.2.88.23

But then, from my web application I want to access the cluster via ip  
10.2.88.24, which is a virtual ip so that if one node goes down, it does  
not matter since I always access 10.2.88.24 and it contains all three of  
them.

Is my intentions clear? How would i configure ElasticSearch for this  
purpose?

//Tommy

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 23, 2013, 11:48am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/2 "2013-07-23T11:48:58Z")

</div>

Just use a DNS CNAME that points to all 3 hosts.  
ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 23 July 2013 21:32, Tommy Albinsson [tommy.albinsson@gmail.com](mailto:tommy.albinsson@gmail.com) wrote:

> Hi,
> 
> I am setting up a new environment with Elasticsearch, and the out of the  
> box zen discovery makes it real easy to load balance.
> 
> But if I want to set up my environment like the following.
> 
> Three servers running on the same network, works perfectly and they find  
> each other.
> 
> es1 10.2.88.21  
> es2 10.2.88.22  
> es3 10.2.88.23
> 
> But then, from my web application I want to access the cluster via ip  
> 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> not matter since I always access 10.2.88.24 and it contains all three of  
> them.
> 
> Is my intentions clear? How would i configure Elasticsearch for this  
> purpose?
> 
> //Tommy
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tommy\_Albinsson](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@Tommy\_Albinsson](https://discuss.elastic.co/u/Tommy_Albinsson)\
**Post date:** [July 23, 2013, 12:27pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/3 "2013-07-23T12:27:30Z")

</div>

Hmms, is it that simple?

If one of the nodes goes down for example es1.domain it does not matter  
then?

That would be just awesome if it was the case.

//Tommy

Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:

> Just use a DNS CNAME that points to all 3 hosts.  
> ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 23 July 2013 21:32, Tommy Albinsson \<[tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) \<javascript:\>
> 
> > wrote:
> 
> > Hi,
> > 
> > I am setting up a new environment with Elasticsearch, and the out of the  
> > box zen discovery makes it real easy to load balance.
> > 
> > But if I want to set up my environment like the following.
> > 
> > Three servers running on the same network, works perfectly and they find  
> > each other.
> > 
> > es1 10.2.88.21  
> > es2 10.2.88.22  
> > es3 10.2.88.23
> > 
> > But then, from my web application I want to access the cluster via ip  
> > 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > not matter since I always access 10.2.88.24 and it contains all three of  
> > them.
> > 
> > Is my intentions clear? How would i configure Elasticsearch for this  
> > purpose?
> > 
> > //Tommy
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tommy\_Albinsson](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@Tommy\_Albinsson](https://discuss.elastic.co/u/Tommy_Albinsson)\
**Post date:** [July 23, 2013, 12:31pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/4 "2013-07-23T12:31:30Z")

</div>

So it does not matter if Elasticsearch is on port 90200?

If I add elastic-cluster.domain as you describe and access it for example  
via elast-cluster.domain:90200, that would be correct woldn't it?

//Tommy

Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy Albinsson:

> Hmms, is it that simple?
> 
> If one of the nodes goes down for example es1.domain it does not matter  
> then?
> 
> That would be just awesome if it was the case.
> 
> //Tommy
> 
> Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> 
> > Just use a DNS CNAME that points to all 3 hosts.  
> > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I am setting up a new environment with Elasticsearch, and the out of the  
> > > box zen discovery makes it real easy to load balance.
> > > 
> > > But if I want to set up my environment like the following.
> > > 
> > > Three servers running on the same network, works perfectly and they find  
> > > each other.
> > > 
> > > es1 10.2.88.21  
> > > es2 10.2.88.22  
> > > es3 10.2.88.23
> > > 
> > > But then, from my web application I want to access the cluster via ip  
> > > 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > them.
> > > 
> > > Is my intentions clear? How would i configure Elasticsearch for this  
> > > purpose?
> > > 
> > > //Tommy
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 23, 2013, 12:41pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/5 "2013-07-23T12:41:40Z")

</div>

If you want a virtual IP, use ucarp. I use it with success, in front of  
nginx, JBoss, httpd, whatever.

[http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)

Jörg

On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson  
[tommy.albinsson@gmail.com](mailto:tommy.albinsson@gmail.com)wrote:

> So it does not matter if Elasticsearch is on port 90200?
> 
> If I add elastic-cluster.domain as you describe and access it for example  
> via elast-cluster.domain:90200, that would be correct woldn't it?
> 
> //Tommy
> 
> Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy Albinsson:
> 
> > Hmms, is it that simple?
> > 
> > If one of the nodes goes down for example es1.domain it does not matter  
> > then?
> > 
> > That would be just awesome if it was the case.
> > 
> > //Tommy
> > 
> > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> > 
> > > Just use a DNS CNAME that points to all 3 hosts.  
> > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > 
> > > Regards,  
> > > Mark Walkom
> > > 
> > > Infrastructure Engineer  
> > > Campaign Monitor  
> > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > 
> > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am setting up a new environment with Elasticsearch, and the out of  
> > > > the box zen discovery makes it real easy to load balance.
> > > > 
> > > > But if I want to set up my environment like the following.
> > > > 
> > > > Three servers running on the same network, works perfectly and they  
> > > > find each other.
> > > > 
> > > > es1 10.2.88.21  
> > > > es2 10.2.88.22  
> > > > es3 10.2.88.23
> > > > 
> > > > But then, from my web application I want to access the cluster via ip  
> > > > 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > > them.
> > > > 
> > > > Is my intentions clear? How would i configure Elasticsearch for this  
> > > > purpose?
> > > > 
> > > > //Tommy
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to elasticsearc...@googlegroups.\*\*com.  
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > .
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tommy\_Albinsson](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@Tommy\_Albinsson](https://discuss.elastic.co/u/Tommy_Albinsson)\
**Post date:** [July 23, 2013, 12:58pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/6 "2013-07-23T12:58:19Z")

</div>

It does not have to be a virtual ip, I just want to use the same url to  
access my cluster and regarding what node goes down it should not matter.

//Tommy

Den tisdagen den 23:e juli 2013 kl. 14:41:40 UTC+2 skrev Jörg Prante:

> If you want a virtual IP, use ucarp. I use it with success, in front of  
> nginx, JBoss, httpd, whatever.
> 
> [http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)
> 
> Jörg
> 
> On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson \<[tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > So it does not matter if Elasticsearch is on port 90200?
> > 
> > If I add elastic-cluster.domain as you describe and access it for example  
> > via elast-cluster.domain:90200, that would be correct woldn't it?
> > 
> > //Tommy
> > 
> > Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy Albinsson:
> > 
> > > Hmms, is it that simple?
> > > 
> > > If one of the nodes goes down for example es1.domain it does not matter  
> > > then?
> > > 
> > > That would be just awesome if it was the case.
> > > 
> > > //Tommy
> > > 
> > > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> > > 
> > > > Just use a DNS CNAME that points to all 3 hosts.  
> > > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > > 
> > > > Regards,  
> > > > Mark Walkom
> > > > 
> > > > Infrastructure Engineer  
> > > > Campaign Monitor  
> > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > 
> > > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > I am setting up a new environment with Elasticsearch, and the out of  
> > > > > the box zen discovery makes it real easy to load balance.
> > > > > 
> > > > > But if I want to set up my environment like the following.
> > > > > 
> > > > > Three servers running on the same network, works perfectly and they  
> > > > > find each other.
> > > > > 
> > > > > es1 10.2.88.21  
> > > > > es2 10.2.88.22  
> > > > > es3 10.2.88.23
> > > > > 
> > > > > But then, from my web application I want to access the cluster via ip  
> > > > > 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > > > them.
> > > > > 
> > > > > Is my intentions clear? How would i configure Elasticsearch for this  
> > > > > purpose?
> > > > > 
> > > > > //Tommy
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to elasticsearc...@googlegroups.\*\*com.  
> > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > .
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google Groups  
> > > > "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tommy\_Albinsson](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@Tommy\_Albinsson](https://discuss.elastic.co/u/Tommy_Albinsson)\
**Post date:** [July 23, 2013, 1:12pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/7 "2013-07-23T13:12:52Z")

</div>

I am on a windows environment also 🙂

//Tommy

Den tisdagen den 23:e juli 2013 kl. 14:58:19 UTC+2 skrev Tommy Albinsson:

> It does not have to be a virtual ip, I just want to use the same url to  
> access my cluster and regarding what node goes down it should not matter.
> 
> //Tommy
> 
> Den tisdagen den 23:e juli 2013 kl. 14:41:40 UTC+2 skrev Jörg Prante:
> 
> > If you want a virtual IP, use ucarp. I use it with success, in front of  
> > nginx, JBoss, httpd, whatever.
> > 
> > [http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)
> > 
> > Jörg
> > 
> > On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)wrote:
> > 
> > > So it does not matter if Elasticsearch is on port 90200?
> > > 
> > > If I add elastic-cluster.domain as you describe and access it for  
> > > example via elast-cluster.domain:90200, that would be correct woldn't it?
> > > 
> > > //Tommy
> > > 
> > > Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy Albinsson:
> > > 
> > > > Hmms, is it that simple?
> > > > 
> > > > If one of the nodes goes down for example es1.domain it does not matter  
> > > > then?
> > > > 
> > > > That would be just awesome if it was the case.
> > > > 
> > > > //Tommy
> > > > 
> > > > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> > > > 
> > > > > Just use a DNS CNAME that points to all 3 hosts.  
> > > > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > > > 
> > > > > Regards,  
> > > > > Mark Walkom
> > > > > 
> > > > > Infrastructure Engineer  
> > > > > Campaign Monitor  
> > > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > > 
> > > > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > I am setting up a new environment with Elasticsearch, and the out of  
> > > > > > the box zen discovery makes it real easy to load balance.
> > > > > > 
> > > > > > But if I want to set up my environment like the following.
> > > > > > 
> > > > > > Three servers running on the same network, works perfectly and they  
> > > > > > find each other.
> > > > > > 
> > > > > > es1 10.2.88.21  
> > > > > > es2 10.2.88.22  
> > > > > > es3 10.2.88.23
> > > > > > 
> > > > > > But then, from my web application I want to access the cluster via ip  
> > > > > > 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > > > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > > > > them.
> > > > > > 
> > > > > > Is my intentions clear? How would i configure Elasticsearch for this  
> > > > > > purpose?
> > > > > > 
> > > > > > //Tommy
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > send an email to elasticsearc...@googlegroups.\*\*com.  
> > > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > .
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 29, 2013, 8:50am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/8 "2013-07-29T08:50:42Z")

</div>

If you use a cname the port doesn't matter. If a node goes down the the  
connection will timeout, and your app should be able to gracefully handle  
this and retry a connection which should connect to a different node. If  
you keep the TTL for the cname down low (eg a minute), then you can easily  
work around any extended downtime for a node by updating the record.  
Using VIPs is good, but if you want something basic this might be the  
easiest.

However a thought occurs that if you are using Windows, specifically server  
2008, then you might be able to leverage Windows Clustering and have a VIP  
and then point a cname to that. Windows Clustering is pretty easy too 🙂

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 23 July 2013 23:12, Tommy Albinsson [tommy.albinsson@gmail.com](mailto:tommy.albinsson@gmail.com) wrote:

> I am on a windows environment also 🙂
> 
> //Tommy
> 
> Den tisdagen den 23:e juli 2013 kl. 14:58:19 UTC+2 skrev Tommy Albinsson:
> 
> > It does not have to be a virtual ip, I just want to use the same url to  
> > access my cluster and regarding what node goes down it should not matter.
> > 
> > //Tommy
> > 
> > Den tisdagen den 23:e juli 2013 kl. 14:41:40 UTC+2 skrev Jörg Prante:
> > 
> > > If you want a virtual IP, use ucarp. I use it with success, in front of  
> > > nginx, JBoss, httpd, whatever.
> > > 
> > > [http://www.pureftpd.org/\*\*project/ucarp](http://www.pureftpd.org/**project/ucarp)[http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)
> > > 
> > > Jörg
> > > 
> > > On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)wrote:
> > > 
> > > > So it does not matter if Elasticsearch is on port 90200?
> > > > 
> > > > If I add elastic-cluster.domain as you describe and access it for  
> > > > example via elast-cluster.domain:90200, that would be correct woldn't it?
> > > > 
> > > > //Tommy
> > > > 
> > > > Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy  
> > > > Albinsson:
> > > > 
> > > > > Hmms, is it that simple?
> > > > > 
> > > > > If one of the nodes goes down for example es1.domain it does not  
> > > > > matter then?
> > > > > 
> > > > > That would be just awesome if it was the case.
> > > > > 
> > > > > //Tommy
> > > > > 
> > > > > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> > > > > 
> > > > > > Just use a DNS CNAME that points to all 3 hosts.  
> > > > > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > > > > 
> > > > > > Regards,  
> > > > > > Mark Walkom
> > > > > > 
> > > > > > Infrastructure Engineer  
> > > > > > Campaign Monitor  
> > > > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > > > 
> > > > > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > I am setting up a new environment with Elasticsearch, and the out of  
> > > > > > > the box zen discovery makes it real easy to load balance.
> > > > > > > 
> > > > > > > But if I want to set up my environment like the following.
> > > > > > > 
> > > > > > > Three servers running on the same network, works perfectly and they  
> > > > > > > find each other.
> > > > > > > 
> > > > > > > es1 10.2.88.21  
> > > > > > > es2 10.2.88.22  
> > > > > > > es3 10.2.88.23
> > > > > > > 
> > > > > > > But then, from my web application I want to access the cluster via  
> > > > > > > ip 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > > > > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > > > > > them.
> > > > > > > 
> > > > > > > Is my intentions clear? How would i configure Elasticsearch for this  
> > > > > > > purpose?
> > > > > > > 
> > > > > > > //Tommy
> > > > > > > 
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to the Google  
> > > > > > > Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > > send an email to elasticsearc...@googlegroups. **c** om.  
> > > > > > > For more options, visit [https://groups.google.com/\*\*grou\*\*ps/opt\_out](https://groups.google.com/ **grou** ps/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > > .
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > > an email to elasticsearc...@googlegroups.\*\*com.  
> > > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > .
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Norberto\_Meijome](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Norberto\_Meijome](https://discuss.elastic.co/u/Norberto_Meijome)\
**Post date:** [July 29, 2013, 8:55am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/9 "2013-07-29T08:55:47Z")

</div>

I would only suggest that the VIP is not used at all by Elasticsearch  
itself (I.e. TCP/9300) only use it to expose the cluster to external  
entities.  
I can imagine ES may get v confused if a node which was on one IP appeared  
on another one without disconnecting from the cluster first... But maybe it  
doesn't care?

BTW, why route all your requests through 1 IP only?  
On 29/07/2013 6:51 PM, "Mark Walkom" [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com) wrote:

> If you use a cname the port doesn't matter. If a node goes down the the  
> connection will timeout, and your app should be able to gracefully handle  
> this and retry a connection which should connect to a different node. If  
> you keep the TTL for the cname down low (eg a minute), then you can easily  
> work around any extended downtime for a node by updating the record.  
> Using VIPs is good, but if you want something basic this might be the  
> easiest.
> 
> However a thought occurs that if you are using Windows, specifically  
> server 2008, then you might be able to leverage Windows Clustering and have  
> a VIP and then point a cname to that. Windows Clustering is pretty easy too  
> 🙂
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 23 July 2013 23:12, Tommy Albinsson [tommy.albinsson@gmail.com](mailto:tommy.albinsson@gmail.com) wrote:
> 
> > I am on a windows environment also 🙂
> > 
> > //Tommy
> > 
> > Den tisdagen den 23:e juli 2013 kl. 14:58:19 UTC+2 skrev Tommy Albinsson:
> > 
> > > It does not have to be a virtual ip, I just want to use the same url to  
> > > access my cluster and regarding what node goes down it should not matter.
> > > 
> > > //Tommy
> > > 
> > > Den tisdagen den 23:e juli 2013 kl. 14:41:40 UTC+2 skrev Jörg Prante:
> > > 
> > > > If you want a virtual IP, use ucarp. I use it with success, in front of  
> > > > nginx, JBoss, httpd, whatever.
> > > > 
> > > > [http://www.pureftpd.org/\*\*project/ucarp](http://www.pureftpd.org/**project/ucarp)[http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)
> > > > 
> > > > Jörg
> > > > 
> > > > On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)wrote:
> > > > 
> > > > > So it does not matter if Elasticsearch is on port 90200?
> > > > > 
> > > > > If I add elastic-cluster.domain as you describe and access it for  
> > > > > example via elast-cluster.domain:90200, that would be correct woldn't it?
> > > > > 
> > > > > //Tommy
> > > > > 
> > > > > Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy  
> > > > > Albinsson:
> > > > > 
> > > > > > Hmms, is it that simple?
> > > > > > 
> > > > > > If one of the nodes goes down for example es1.domain it does not  
> > > > > > matter then?
> > > > > > 
> > > > > > That would be just awesome if it was the case.
> > > > > > 
> > > > > > //Tommy
> > > > > > 
> > > > > > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> > > > > > 
> > > > > > > Just use a DNS CNAME that points to all 3 hosts.  
> > > > > > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > > > > > 
> > > > > > > Regards,  
> > > > > > > Mark Walkom
> > > > > > > 
> > > > > > > Infrastructure Engineer  
> > > > > > > Campaign Monitor  
> > > > > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > > > > 
> > > > > > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > > > > > > 
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > I am setting up a new environment with Elasticsearch, and the out  
> > > > > > > > of the box zen discovery makes it real easy to load balance.
> > > > > > > > 
> > > > > > > > But if I want to set up my environment like the following.
> > > > > > > > 
> > > > > > > > Three servers running on the same network, works perfectly and they  
> > > > > > > > find each other.
> > > > > > > > 
> > > > > > > > es1 10.2.88.21  
> > > > > > > > es2 10.2.88.22  
> > > > > > > > es3 10.2.88.23
> > > > > > > > 
> > > > > > > > But then, from my web application I want to access the cluster via  
> > > > > > > > ip 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > > > > > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > > > > > > them.
> > > > > > > > 
> > > > > > > > Is my intentions clear? How would i configure Elasticsearch for  
> > > > > > > > this purpose?
> > > > > > > > 
> > > > > > > > //Tommy
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > You received this message because you are subscribed to the Google  
> > > > > > > > Groups "elasticsearch" group.  
> > > > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > > > send an email to elasticsearc...@googlegroups. **c** om.  
> > > > > > > > For more options, visit [https://groups.google.com/\*\*grou](https://groups.google.com/**grou)\*\*  
> > > > > > > > ps/opt\_out [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > 
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to the Google  
> > > > > > > Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > > > an email to elasticsearc...@googlegroups.\*\*com.  
> > > > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > > .
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google Groups  
> > > > "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 29, 2013, 11:15am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/10 "2013-07-29T11:15:21Z")

</div>

In that case, take nginx, and put it up in load balancing mode like  
described here, with a short fail timeout

> **[How To Set Up Nginx Load Balancing | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-load-balancing)**
>
> This article covers how to set up a simple load balancer on a DigitalOcean droplet with nginx. The tutorial covers setting up a round robin loadbalancer that can then direct site visitors to one of a set of IPs

DNS round robin is not recommended, unless you accept downtimes for many  
minutes. You can't control the TTL how it propagates through all the DNS  
services when a server goes down.

Do not expect high performance and scalability with Windows.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Norberto\_Meijome](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Norberto\_Meijome](https://discuss.elastic.co/u/Norberto_Meijome)\
**Post date:** [July 29, 2013, 11:40am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/11 "2013-07-29T11:40:07Z")

</div>

+1 on all counts ( wont comment on windows 😉 ) .

fwiw, our usual setup is  
[ a pair of LBs using haproxy - http checks if using http, or simple tcp  
if relying on thrift] --\> [ a number n of instances running in master-only  
mode, data= false ,effectively master + routing only] --\> [ a number m of  
data nodes].

Linux on EC2.

( got to play a bit with using specific http queries to get an http ok/  
error from ES ,when using thrift ).

b

On Mon, Jul 29, 2013 at 9:15 PM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
[joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:

> In that case, take nginx, and put it up in load balancing mode like  
> described here, with a short fail timeout  
> [How To Set Up Nginx Load Balancing | DigitalOcean](https://www.digitalocean.com/community/articles/how-to-set-up-nginx-load-balancing)
> 
> DNS round robin is not recommended, unless you accept downtimes for many  
> minutes. You can't control the TTL how it propagates through all the DNS  
> services when a server goes down.
> 
> Do not expect high performance and scalability with Windows.
> 
> Jörg
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Norberto 'Beto' Meijome

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Stefan\_Fussenegger](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Stefan\_Fussenegger](https://discuss.elastic.co/u/Stefan_Fussenegger)\
**Post date:** [July 29, 2013, 2:15pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/12 "2013-07-29T14:15:32Z")

</div>

What about using an additional elasticsearch node (data=false,  
master=false) instead of nginx?

Cheers

Am Montag, 29. Juli 2013 13:15:21 UTC+2 schrieb Jörg Prante:

> In that case, take nginx, and put it up in load balancing mode like  
> described here, with a short fail timeout  
> [How To Set Up Nginx Load Balancing | DigitalOcean](https://www.digitalocean.com/community/articles/how-to-set-up-nginx-load-balancing)
> 
> DNS round robin is not recommended, unless you accept downtimes for many  
> minutes. You can't control the TTL how it propagates through all the DNS  
> services when a server goes down.
> 
> Do not expect high performance and scalability with Windows.
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 29, 2013, 11:13pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/13 "2013-07-29T23:13:04Z")

</div>

nginx is preferable if you want also request / response filtering, static  
file serving, authentication, compression, logging, traffic shaping, http  
flooding prevention, awesome concurrency. In combination with ucarp on a  
local network, I set up nginx's in a row of machines, avoiding any SPOF  
(within a data center) with failover of 1 second, no matter if there is a  
Java EE JVM, or Perl/Python/Ruby/PHP processes connected to ES in the back  
yard.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Norberto\_Meijome](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Norberto\_Meijome](https://discuss.elastic.co/u/Norberto_Meijome)\
**Post date:** [July 30, 2013, 11:08am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/14 "2013-07-30T11:08:33Z")

</div>

@Jorg, have u tried doing tcp proxying w/nginx?  
[GitHub - yaoweibin/nginx\_tcp\_proxy\_module: add the feature of tcp proxy with nginx, with health check and status monitor](https://github.com/yaoweibin/nginx_tcp_proxy_module) ( for use w/ ES-thrift  
plugin)

On Tue, Jul 30, 2013 at 9:13 AM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
[joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:

> nginx is preferable if you want also request / response filtering, static  
> file serving, authentication, compression, logging, traffic shaping, http  
> flooding prevention, awesome concurrency. In combination with ucarp on a  
> local network, I set up nginx's in a row of machines, avoiding any SPOF  
> (within a data center) with failover of 1 second, no matter if there is a  
> Java EE JVM, or Perl/Python/Ruby/PHP processes connected to ES in the back  
> yard.
> 
> Jörg
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Norberto 'Beto' Meijome

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 30, 2013, 12:48pm UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/15 "2013-07-30T12:48:07Z")

</div>

No. What I'd like to use is nginx websocket proxying (for event processing  
with ES, not implemented yet) [WebSocket proxying](http://nginx.org/en/docs/http/websocket.html)

Jörg

On Tue, Jul 30, 2013 at 1:08 PM, Norberto Meijome [numard@gmail.com](mailto:numard@gmail.com) wrote:

> @Jorg, have u tried doing tcp proxying w/nginx?  
> [GitHub - yaoweibin/nginx\_tcp\_proxy\_module: add the feature of tcp proxy with nginx, with health check and status monitor](https://github.com/yaoweibin/nginx_tcp_proxy_module) ( for use w/  
> ES-thrift plugin)
> 
> On Tue, Jul 30, 2013 at 9:13 AM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
> [joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:
> 
> > nginx is preferable if you want also request / response filtering, static  
> > file serving, authentication, compression, logging, traffic shaping, http  
> > flooding prevention, awesome concurrency. In combination with ucarp on a  
> > local network, I set up nginx's in a row of machines, avoiding any SPOF  
> > (within a data center) with failover of 1 second, no matter if there is a  
> > Java EE JVM, or Perl/Python/Ruby/PHP processes connected to ES in the back  
> > yard.
> > 
> > Jörg
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Norberto 'Beto' Meijome
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tommy\_Albinsson](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@Tommy\_Albinsson](https://discuss.elastic.co/u/Tommy_Albinsson)\
**Post date:** [July 31, 2013, 7:58am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/16 "2013-07-31T07:58:10Z")

</div>

@Norberto

Why route everythin to 1 ip only, that is because i don't want to target a  
specific node because what happens if that ones goes down.

Ofcourse I can build this into my application to try different ip addresses  
if one does not answer but setting up a VIP pointing containing all the  
node ips does seem like a good idea, doesn't it?

Den måndagen den 29:e juli 2013 kl. 10:55:47 UTC+2 skrev Norberto Meijome:

> I would only suggest that the VIP is not used at all by Elasticsearch  
> itself (I.e. TCP/9300) only use it to expose the cluster to external  
> entities.  
> I can imagine ES may get v confused if a node which was on one IP appeared  
> on another one without disconnecting from the cluster first... But maybe it  
> doesn't care?
> 
> BTW, why route all your requests through 1 IP only?  
> On 29/07/2013 6:51 PM, "Mark Walkom" \<[ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)\<javascript:\>\>  
> wrote:
> 
> > If you use a cname the port doesn't matter. If a node goes down the the  
> > connection will timeout, and your app should be able to gracefully handle  
> > this and retry a connection which should connect to a different node. If  
> > you keep the TTL for the cname down low (eg a minute), then you can easily  
> > work around any extended downtime for a node by updating the record.  
> > Using VIPs is good, but if you want something basic this might be the  
> > easiest.
> > 
> > However a thought occurs that if you are using Windows, specifically  
> > server 2008, then you might be able to leverage Windows Clustering and have  
> > a VIP and then point a cname to that. Windows Clustering is pretty easy too  
> > 🙂
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 23 July 2013 23:12, Tommy Albinsson \<[tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)\<javascript:\>
> > 
> > > wrote:
> > 
> > > I am on a windows environment also 🙂
> > > 
> > > //Tommy
> > > 
> > > Den tisdagen den 23:e juli 2013 kl. 14:58:19 UTC+2 skrev Tommy Albinsson:
> > > 
> > > > It does not have to be a virtual ip, I just want to use the same url to  
> > > > access my cluster and regarding what node goes down it should not matter.
> > > > 
> > > > //Tommy
> > > > 
> > > > Den tisdagen den 23:e juli 2013 kl. 14:41:40 UTC+2 skrev Jörg Prante:
> > > > 
> > > > > If you want a virtual IP, use ucarp. I use it with success, in front  
> > > > > of nginx, JBoss, httpd, whatever.
> > > > > 
> > > > > [http://www.pureftpd.org/\*\*project/ucarp](http://www.pureftpd.org/**project/ucarp)[http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)
> > > > > 
> > > > > Jörg
> > > > > 
> > > > > On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson \<[tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)
> > > > > 
> > > > > > wrote:
> > > > > 
> > > > > > So it does not matter if Elasticsearch is on port 90200?
> > > > > > 
> > > > > > If I add elastic-cluster.domain as you describe and access it for  
> > > > > > example via elast-cluster.domain:90200, that would be correct woldn't it?
> > > > > > 
> > > > > > //Tommy
> > > > > > 
> > > > > > Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy  
> > > > > > Albinsson:
> > > > > > 
> > > > > > > Hmms, is it that simple?
> > > > > > > 
> > > > > > > If one of the nodes goes down for example es1.domain it does not  
> > > > > > > matter then?
> > > > > > > 
> > > > > > > That would be just awesome if it was the case.
> > > > > > > 
> > > > > > > //Tommy
> > > > > > > 
> > > > > > > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark Walkom:
> > > > > > > 
> > > > > > > > Just use a DNS CNAME that points to all 3 hosts.  
> > > > > > > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > > > > > > 
> > > > > > > > Regards,  
> > > > > > > > Mark Walkom
> > > > > > > > 
> > > > > > > > Infrastructure Engineer  
> > > > > > > > Campaign Monitor  
> > > > > > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > > > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > > > > > 
> > > > > > > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)wrote:
> > > > > > > > 
> > > > > > > > > Hi,
> > > > > > > > > 
> > > > > > > > > I am setting up a new environment with Elasticsearch, and the out  
> > > > > > > > > of the box zen discovery makes it real easy to load balance.
> > > > > > > > > 
> > > > > > > > > But if I want to set up my environment like the following.
> > > > > > > > > 
> > > > > > > > > Three servers running on the same network, works perfectly and  
> > > > > > > > > they find each other.
> > > > > > > > > 
> > > > > > > > > es1 10.2.88.21  
> > > > > > > > > es2 10.2.88.22  
> > > > > > > > > es3 10.2.88.23
> > > > > > > > > 
> > > > > > > > > But then, from my web application I want to access the cluster via  
> > > > > > > > > ip 10.2.88.24, which is a virtual ip so that if one node goes down, it does  
> > > > > > > > > not matter since I always access 10.2.88.24 and it contains all three of  
> > > > > > > > > them.
> > > > > > > > > 
> > > > > > > > > Is my intentions clear? How would i configure Elasticsearch for  
> > > > > > > > > this purpose?
> > > > > > > > > 
> > > > > > > > > //Tommy
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > You received this message because you are subscribed to the Google  
> > > > > > > > > Groups "elasticsearch" group.  
> > > > > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > > > > send an email to elasticsearc...@googlegroups. **c** om.  
> > > > > > > > > For more options, visit [https://groups.google.com/\*\*grou](https://groups.google.com/**grou)\*\*  
> > > > > > > > > ps/opt\_out [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > You received this message because you are subscribed to the Google  
> > > > > > > > Groups "elasticsearch" group.  
> > > > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > > > send an email to elasticsearc...@googlegroups.\*\*com.  
> > > > > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > > > .
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Norberto\_Meijome](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Norberto\_Meijome](https://discuss.elastic.co/u/Norberto_Meijome)\
**Post date:** [July 31, 2013, 9:14am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/17 "2013-07-31T09:14:29Z")

</div>

sure, u point your load balancer to a number of nodes, and your app speaks  
to your LB(s) . pretty standard design...

On Wed, Jul 31, 2013 at 5:58 PM, Tommy Albinsson  
[tommy.albinsson@gmail.com](mailto:tommy.albinsson@gmail.com)wrote:

> @Norberto
> 
> Why route everythin to 1 ip only, that is because i don't want to target a  
> specific node because what happens if that ones goes down.
> 
> Ofcourse I can build this into my application to try different ip  
> addresses if one does not answer but setting up a VIP pointing containing  
> all the node ips does seem like a good idea, doesn't it?
> 
> Den måndagen den 29:e juli 2013 kl. 10:55:47 UTC+2 skrev Norberto Meijome:
> 
> > I would only suggest that the VIP is not used at all by Elasticsearch  
> > itself (I.e. TCP/9300) only use it to expose the cluster to external  
> > entities.  
> > I can imagine ES may get v confused if a node which was on one IP  
> > appeared on another one without disconnecting from the cluster first... But  
> > maybe it doesn't care?
> > 
> > BTW, why route all your requests through 1 IP only?  
> > On 29/07/2013 6:51 PM, "Mark Walkom" [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) wrote:
> > 
> > > If you use a cname the port doesn't matter. If a node goes down the the  
> > > connection will timeout, and your app should be able to gracefully handle  
> > > this and retry a connection which should connect to a different node. If  
> > > you keep the TTL for the cname down low (eg a minute), then you can easily  
> > > work around any extended downtime for a node by updating the record.  
> > > Using VIPs is good, but if you want something basic this might be the  
> > > easiest.
> > > 
> > > However a thought occurs that if you are using Windows, specifically  
> > > server 2008, then you might be able to leverage Windows Clustering and have  
> > > a VIP and then point a cname to that. Windows Clustering is pretty easy too  
> > > 🙂
> > > 
> > > Regards,  
> > > Mark Walkom
> > > 
> > > Infrastructure Engineer  
> > > Campaign Monitor  
> > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > 
> > > On 23 July 2013 23:12, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com) wrote:
> > > 
> > > > I am on a windows environment also 🙂
> > > > 
> > > > //Tommy
> > > > 
> > > > Den tisdagen den 23:e juli 2013 kl. 14:58:19 UTC+2 skrev Tommy  
> > > > Albinsson:
> > > > 
> > > > > It does not have to be a virtual ip, I just want to use the same url  
> > > > > to access my cluster and regarding what node goes down it should not matter.
> > > > > 
> > > > > //Tommy
> > > > > 
> > > > > Den tisdagen den 23:e juli 2013 kl. 14:41:40 UTC+2 skrev Jörg Prante:
> > > > > 
> > > > > > If you want a virtual IP, use ucarp. I use it with success, in front  
> > > > > > of nginx, JBoss, httpd, whatever.
> > > > > > 
> > > > > > [http://www.pureftpd.org/\*\*projec\*\*t/ucarp](http://www.pureftpd.org/ **projec** t/ucarp)[http://www.pureftpd.org/project/ucarp](http://www.pureftpd.org/project/ucarp)
> > > > > > 
> > > > > > Jörg
> > > > > > 
> > > > > > On Tue, Jul 23, 2013 at 2:31 PM, Tommy Albinsson \<  
> > > > > > [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)\> wrote:
> > > > > > 
> > > > > > > So it does not matter if Elasticsearch is on port 90200?
> > > > > > > 
> > > > > > > If I add elastic-cluster.domain as you describe and access it for  
> > > > > > > example via elast-cluster.domain:90200, that would be correct woldn't it?
> > > > > > > 
> > > > > > > //Tommy
> > > > > > > 
> > > > > > > Den tisdagen den 23:e juli 2013 kl. 14:27:30 UTC+2 skrev Tommy  
> > > > > > > Albinsson:
> > > > > > > 
> > > > > > > > Hmms, is it that simple?
> > > > > > > > 
> > > > > > > > If one of the nodes goes down for example es1.domain it does not  
> > > > > > > > matter then?
> > > > > > > > 
> > > > > > > > That would be just awesome if it was the case.
> > > > > > > > 
> > > > > > > > //Tommy
> > > > > > > > 
> > > > > > > > Den tisdagen den 23:e juli 2013 kl. 13:48:58 UTC+2 skrev Mark  
> > > > > > > > Walkom:
> > > > > > > > 
> > > > > > > > > Just use a DNS CNAME that points to all 3 hosts.  
> > > > > > > > > ie elastic-cluster.domain = es1.domain, es2.domain, es3.domain.
> > > > > > > > > 
> > > > > > > > > Regards,  
> > > > > > > > > Mark Walkom
> > > > > > > > > 
> > > > > > > > > Infrastructure Engineer  
> > > > > > > > > Campaign Monitor  
> > > > > > > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > > > > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > > > > > > 
> > > > > > > > > On 23 July 2013 21:32, Tommy Albinsson [tommy.a...@gmail.com](mailto:tommy.a...@gmail.com)wrote:
> > > > > > > > > 
> > > > > > > > > > Hi,
> > > > > > > > > > 
> > > > > > > > > > I am setting up a new environment with Elasticsearch, and the out  
> > > > > > > > > > of the box zen discovery makes it real easy to load balance.
> > > > > > > > > > 
> > > > > > > > > > But if I want to set up my environment like the following.
> > > > > > > > > > 
> > > > > > > > > > Three servers running on the same network, works perfectly and  
> > > > > > > > > > they find each other.
> > > > > > > > > > 
> > > > > > > > > > es1 10.2.88.21  
> > > > > > > > > > es2 10.2.88.22  
> > > > > > > > > > es3 10.2.88.23
> > > > > > > > > > 
> > > > > > > > > > But then, from my web application I want to access the cluster  
> > > > > > > > > > via ip 10.2.88.24, which is a virtual ip so that if one node goes down, it  
> > > > > > > > > > does not matter since I always access 10.2.88.24 and it contains all three  
> > > > > > > > > > of them.
> > > > > > > > > > 
> > > > > > > > > > Is my intentions clear? How would i configure Elasticsearch for  
> > > > > > > > > > this purpose?
> > > > > > > > > > 
> > > > > > > > > > //Tommy
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > You received this message because you are subscribed to the  
> > > > > > > > > > Google Groups "elasticsearch" group.  
> > > > > > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > > > > > send an email to elasticsearc...@googlegroups.\*\*c**om.  
> > > > > > > > > > For more options, visit [https://groups.google.com/\*\*grou](https://groups.google.com/**grou)**  
> > > > > > > > > > ps/opt\_out [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > You received this message because you are subscribed to the Google  
> > > > > > > > > Groups "elasticsearch" group.  
> > > > > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > > > > send an email to elasticsearc...@googlegroups. **c** om.  
> > > > > > > > > For more options, visit [https://groups.google.com/\*\*grou\*\*ps/opt\_out](https://groups.google.com/ **grou** ps/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > > > > .
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > > an email to elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).  
> > > > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > .
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).  
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Norberto 'Beto' Meijome

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:23am UTC](https://discuss.elastic.co/t/load-balancing-elasticsearch-with-virtual-ip/12897/18 "2017-07-06T02:23:33Z")

</div>


