# Will a rolling restart lose data?

**URL:** <https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917>\
**Category:** Elasticsearch\
**Created:** [April 17, 2010, 4:07pm UTC](https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917 "2010-04-17T16:07:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grant\_Rodgers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grant_rodgers/32/3204_2.png) [@Grant\_Rodgers](https://discuss.elastic.co/u/Grant_Rodgers)\
**Post date:** [April 17, 2010, 4:07pm UTC](https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917/1 "2010-04-17T16:07:17Z")

</div>

I've been looking at the docs and couldn't find the answer to this, so  
I thought I'd ask the list.

Say I've changed the configuration of my elasticsearch cluster, and I  
want to restart every node to pick up the new config. Is there a  
possibility of losing data? Seems like there could be if every  
machine that hosts a shard happens to be restarting at the same time.

What's a good way to do a rolling restart without losing anything?

Thanks!

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 17, 2010, 4:13pm UTC](https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917/2 "2010-04-17T16:13:19Z")

</div>

> Say I've changed the configuration of my elasticsearch cluster, and I  
> want to restart every node to pick up the new config. Is there a  
> possibility of losing data? Seems like there could be if every  
> machine that hosts a shard happens to be restarting at the same time.
> 
> What's a good way to do a rolling restart without losing anything?

> From what I've seen of doing this in practise, before a node shuts down,  
> it syncs its data with the other nodes, and possibly tries to snapshot  
> the gateway (if required).

So, shutdown one node, restart it, wait for the cluster\_health to be  
'green' again (requires at least three running nodes, I think), then  
move on to the next node.

clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 17, 2010, 4:47pm UTC](https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917/3 "2010-04-17T16:47:23Z")

</div>

When you shut down a node, shards allocated to it are reallocated to other  
nodes. When you start it up again, shards are redistributed to it. If, for  
example, you have set the number\_of\_replicas set to 1, then each shard will  
have a replica, meaning that is its assigned to a specific node, it will  
recover its state from another node that is running. If you have a gateway  
set, then the first shard will recover its state from the gateway.

cheers,  
shay.banon

On Sat, Apr 17, 2010 at 7:13 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> > Say I've changed the configuration of my elasticsearch cluster, and I  
> > want to restart every node to pick up the new config. Is there a  
> > possibility of losing data? Seems like there could be if every  
> > machine that hosts a shard happens to be restarting at the same time.
> > 
> > What's a good way to do a rolling restart without losing anything?
> 
> > From what I've seen of doing this in practise, before a node shuts down,  
> > it syncs its data with the other nodes, and possibly tries to snapshot  
> > the gateway (if required).
> 
> So, shutdown one node, restart it, wait for the cluster\_health to be  
> 'green' again (requires at least three running nodes, I think), then  
> move on to the next node.
> 
> clint

---

<div class="post-metadata">

**Author:** ![jimmy\_wen](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jimmy\_wen](https://discuss.elastic.co/u/jimmy_wen)\
**Post date:** [May 10, 2010, 10:39am UTC](https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917/4 "2010-05-10T10:39:57Z")

</div>

where a complete cluster down happened , It will still lose data ,right?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:24am UTC](https://discuss.elastic.co/t/will-a-rolling-restart-lose-data/2917/5 "2017-07-06T04:24:11Z")

</div>


