# Elastic cluster in Kubernetes using statefulsets ,data lost during cluster restart

**URL:** <https://discuss.elastic.co/t/elastic-cluster-in-kubernetes-using-statefulsets-data-lost-during-cluster-restart/157264>\
**Category:** Elasticsearch\
**Created:** [November 19, 2018, 4:00am UTC](https://discuss.elastic.co/t/elastic-cluster-in-kubernetes-using-statefulsets-data-lost-during-cluster-restart/157264 "2018-11-19T04:00:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Punith](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Punith](https://discuss.elastic.co/u/Punith)\
**Post date:** [November 19, 2018, 4:00am UTC](https://discuss.elastic.co/t/elastic-cluster-in-kubernetes-using-statefulsets-data-lost-during-cluster-restart/157264/1 "2018-11-19T04:00:17Z")

</div>

Hi,  
We have a Kubernetes statefulset Elastic cluster with 3 master nodes and 2 data nodes.Elastic version being 6.4.2.After a cluster restart none of the old data i.e indices are present and only new data is being displayed even though It is being attached to the same pvc after the restart.It happens each time during cluster restart.Any idea on how to resolve this issue?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [November 19, 2018, 6:59am UTC](https://discuss.elastic.co/t/elastic-cluster-in-kubernetes-using-statefulsets-data-lost-during-cluster-restart/157264/2 "2018-11-19T06:59:01Z")

</div>

This has come up a few times before and in each case the cause was that Elasticsearch wasn't configured to use the correct data path: a persistent volume was being mounted, but Elasticsearch wasn't using it and was putting its data somewhere ephemeral. Make sure that `path.data` is set correctly and that there is data being written to the persistent volume.

---

<div class="post-metadata">

**Author:** ![Punith](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Punith](https://discuss.elastic.co/u/Punith)\
**Post date:** [November 20, 2018, 4:25am UTC](https://discuss.elastic.co/t/elastic-cluster-in-kubernetes-using-statefulsets-data-lost-during-cluster-restart/157264/3 "2018-11-20T04:25:37Z")

</div>

It's fixed now! thanks!

---

<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:** [December 18, 2018, 4:25am UTC](https://discuss.elastic.co/t/elastic-cluster-in-kubernetes-using-statefulsets-data-lost-during-cluster-restart/157264/4 "2018-12-18T04:25:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
