# Multiple nodes on same machine : replicas?

**URL:** <https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566>\
**Category:** Elasticsearch\
**Created:** [May 6, 2015, 7:24am UTC](https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566 "2015-05-06T07:24:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DH1](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DH1](https://discuss.elastic.co/u/DH1)\
**Post date:** [May 6, 2015, 7:24am UTC](https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566/1 "2015-05-06T07:24:18Z")

</div>

Hello, everyone.

I'm trying to set up a cluster of 10 nodes, distributed on five different  
computers.  
Each computer have 2 full installation of ES v 0.90.5.  
All indices on this cluster have 5 shards, 1 replica

I want to make sure that a replica will never be on the same computer as  
its primary, because a computer crash is far more common than an ES crash.  
I'm currently trying a method using "node.machine: aValue" and  
"cluster.routing.allocation.awareness.attributes: machine" in the  
configuration of my nodes, where aValue is different on each machine.

According to this :

> <https://github.com/elastic/elasticsearch/issues/1352>

and according to the doc for 0.90.5 as well, this should ensure that I get  
what I want.  
My problem is that, when creating my indices, all primary shards get  
allocated on the two nodes of a single machine, and no replica gets  
created, thus resulting in a yellow state.

Is there a way to have the shards distributed evenly through all nodes,  
while ensuring that my replicas will never be on the same computer as their  
primaries?

Thanks for any infos on that matter.

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [May 6, 2015, 10:01am UTC](https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566/2 "2015-05-06T10:01:00Z")

</div>

Have you tried upgrading? That's a super old version which may not help.

Though that is the right setting.  
On 06/05/2015 3:24 pm, "DH" [ciddp195@gmail.com](mailto:ciddp195@gmail.com) wrote:

> Hello, everyone.
> 
> I'm trying to set up a cluster of 10 nodes, distributed on five different  
> computers.  
> Each computer have 2 full installation of ES v 0.90.5.  
> All indices on this cluster have 5 shards, 1 replica
> 
> I want to make sure that a replica will never be on the same computer as  
> its primary, because a computer crash is far more common than an ES crash.  
> I'm currently trying a method using "node.machine: aValue" and  
> "cluster.routing.allocation.awareness.attributes: machine" in the  
> configuration of my nodes, where aValue is different on each machine.
> 
> According to this :  
> [Shard allocation awareness (rack aware, zone aware, for example) · Issue #1352 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/1352)
> 
> and according to the doc for 0.90.5 as well, this should ensure that I  
> get what I want.  
> My problem is that, when creating my indices, all primary shards get  
> allocated on the two nodes of a single machine, and no replica gets  
> created, thus resulting in a yellow state.
> 
> Is there a way to have the shards distributed evenly through all nodes,  
> while ensuring that my replicas will never be on the same computer as their  
> primaries?
> 
> Thanks for any infos on that matter.
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X\_OHNYbr0sZJXCghGjDc\_uw2kCpLSGACE5OnMJxwaEKFw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_OHNYbr0sZJXCghGjDc_uw2kCpLSGACE5OnMJxwaEKFw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [May 6, 2015, 11:45am UTC](https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566/3 "2015-05-06T11:45:49Z")

</div>

afaik, you don't change the cluster.routing .\* , es 0.90 should be  
intelligent enough to redistribute the shards evenly across the nodes in  
the cluster.

hth

jason

On Wed, May 6, 2015 at 3:24 PM, DH [ciddp195@gmail.com](mailto:ciddp195@gmail.com) wrote:

> Hello, everyone.
> 
> I'm trying to set up a cluster of 10 nodes, distributed on five different  
> computers.  
> Each computer have 2 full installation of ES v 0.90.5.  
> All indices on this cluster have 5 shards, 1 replica
> 
> I want to make sure that a replica will never be on the same computer as  
> its primary, because a computer crash is far more common than an ES crash.  
> I'm currently trying a method using "node.machine: aValue" and  
> "cluster.routing.allocation.awareness.attributes: machine" in the  
> configuration of my nodes, where aValue is different on each machine.
> 
> According to this :  
> [Shard allocation awareness (rack aware, zone aware, for example) · Issue #1352 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/1352)
> 
> and according to the doc for 0.90.5 as well, this should ensure that I  
> get what I want.  
> My problem is that, when creating my indices, all primary shards get  
> allocated on the two nodes of a single machine, and no replica gets  
> created, thus resulting in a yellow state.
> 
> Is there a way to have the shards distributed evenly through all nodes,  
> while ensuring that my replicas will never be on the same computer as their  
> primaries?
> 
> Thanks for any infos on that matter.
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHO4itwpOzhnyhJnN6Zjnv2VxkdG2844\_K54BQFmkJZVF8O\_mA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHO4itwpOzhnyhJnN6Zjnv2VxkdG2844_K54BQFmkJZVF8O_mA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [May 6, 2015, 12:21pm UTC](https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566/4 "2015-05-06T12:21:15Z")

</div>

Why do you want to have 2 nodes per machine?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 6 mai 2015 à 13:45, Jason Wee [peichieh@gmail.com](mailto:peichieh@gmail.com) a écrit :
> 
> afaik, you don't change the cluster.routing .\* , es 0.90 should be intelligent enough to redistribute the shards evenly across the nodes in the cluster.
> 
> hth
> 
> jason
> 
> > On Wed, May 6, 2015 at 3:24 PM, DH [ciddp195@gmail.com](mailto:ciddp195@gmail.com) wrote:  
> > Hello, everyone.
> > 
> > I'm trying to set up a cluster of 10 nodes, distributed on five different computers.  
> > Each computer have 2 full installation of ES v 0.90.5.  
> > All indices on this cluster have 5 shards, 1 replica
> > 
> > I want to make sure that a replica will never be on the same computer as its primary, because a computer crash is far more common than an ES crash.  
> > I'm currently trying a method using "node.machine: aValue" and "cluster.routing.allocation.awareness.attributes: machine" in the configuration of my nodes, where aValue is different on each machine.
> > 
> > According to this :  
> > [Shard allocation awareness (rack aware, zone aware, for example) · Issue #1352 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/1352)
> > 
> > and according to the doc for 0.90.5 as well, this should ensure that I get what I want.  
> > My problem is that, when creating my indices, all primary shards get allocated on the two nodes of a single machine, and no replica gets created, thus resulting in a yellow state.
> > 
> > Is there a way to have the shards distributed evenly through all nodes, while ensuring that my replicas will never be on the same computer as their primaries?
> > 
> > ## Thanks for any infos on that matter.
> > 
> > ## Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> > 
> > 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).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3c839191-c0e9-41ce-a749-869c76cec37b%40googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHO4itwpOzhnyhJnN6Zjnv2VxkdG2844\_K54BQFmkJZVF8O\_mA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHO4itwpOzhnyhJnN6Zjnv2VxkdG2844_K54BQFmkJZVF8O_mA%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/DD660B6A-867A-42FA-848E-74ABAFD96ABB%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/DD660B6A-867A-42FA-848E-74ABAFD96ABB%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:15am UTC](https://discuss.elastic.co/t/multiple-nodes-on-same-machine-replicas/23566/5 "2017-07-06T00:15:24Z")

</div>


