# ES cluster in Amazon auto scaling group

**URL:** <https://discuss.elastic.co/t/es-cluster-in-amazon-auto-scaling-group/18649>\
**Category:** Elasticsearch\
**Created:** [July 14, 2014, 1:52pm UTC](https://discuss.elastic.co/t/es-cluster-in-amazon-auto-scaling-group/18649 "2014-07-14T13:52:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [July 14, 2014, 1:52pm UTC](https://discuss.elastic.co/t/es-cluster-in-amazon-auto-scaling-group/18649/1 "2014-07-14T13:52:12Z")

</div>

Hi,

I have setup an autoscaling group in Amazon for my Elasticsearch Cluster.  
Everything was working fine with the discovery and all.

I currently have 2 instances in the AutoScaling group. I started to work on  
a new Elastic Load Balancer health check, but since it's not done yet, the  
check only pass for 1 node and the other is terminated every 3000 seconds.

My cluster is configured with the default settings, 5 shards, 1 replica. So  
in theory, when 1 node is terminated, the fist one should keep all the data  
and automatically know that it's alone in the cluster. When a new node is  
spawned, it will automatically add it and sync.

During the WE, this continued to happen, but I'm now in a situation where  
my cluster is in a bad state, my indexes doesn't have 5 shards but 3,  
Elastic HQ plugin tells me there's more than 2 nodes, unassigned shards.

This test cluster doesn't have any data, less than 1000 documents, so the  
replication time is minimal.

What do you recommend ?

--  
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/442caee3-4c6c-4ff8-b672-593e851f861f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/442caee3-4c6c-4ff8-b672-593e851f861f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [July 14, 2014, 2:10pm UTC](https://discuss.elastic.co/t/es-cluster-in-amazon-auto-scaling-group/18649/2 "2014-07-14T14:10:26Z")

</div>

Is it possible that when 2 nodes were up, somehow some shards an their  
replica ended up on the same node, so when it was terminated, I lost data ?

Isn't ES supposed to balance shard/replica in a way that this won't happen ?

On Monday, July 14, 2014 9:52:12 AM UTC-4, Bastien Chong wrote:

> Hi,
> 
> I have setup an autoscaling group in Amazon for my Elasticsearch Cluster.  
> Everything was working fine with the discovery and all.
> 
> I currently have 2 instances in the AutoScaling group. I started to work  
> on a new Elastic Load Balancer health check, but since it's not done yet,  
> the check only pass for 1 node and the other is terminated every 3000  
> seconds.
> 
> My cluster is configured with the default settings, 5 shards, 1 replica.  
> So in theory, when 1 node is terminated, the fist one should keep all the  
> data and automatically know that it's alone in the cluster. When a new node  
> is spawned, it will automatically add it and sync.
> 
> During the WE, this continued to happen, but I'm now in a situation where  
> my cluster is in a bad state, my indexes doesn't have 5 shards but 3,  
> Elastic HQ plugin tells me there's more than 2 nodes, unassigned shards.
> 
> This test cluster doesn't have any data, less than 1000 documents, so the  
> replication time is minimal.
> 
> What do you recommend ?

--  
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/77c2be3c-0013-43d1-a513-6778d4682cfd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77c2be3c-0013-43d1-a513-6778d4682cfd%40googlegroups.com).  
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, 1:16am UTC](https://discuss.elastic.co/t/es-cluster-in-amazon-auto-scaling-group/18649/3 "2017-07-06T01:16:06Z")

</div>


