# Best practice of using volumes across a cluster

**URL:** <https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [September 15, 2022, 8:19am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483 "2022-09-15T08:19:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Kulik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitry_kulik/32/105273_2.png) [@Dmitry\_Kulik](https://discuss.elastic.co/u/Dmitry_Kulik)\
**Post date:** [September 15, 2022, 8:19am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483/1 "2022-09-15T08:19:16Z")

</div>

Hi all. Wanted to ask you, what is the best approach for using volumes within a cluster?

So basically I have a cluster with 3 master/data nodes (combined, not separate). And I want to increase this cluster and not lose any data.

Current my solution is to use 1 EFS storage (I'm using AWS to manage the cluster) and attach it to all nodes. And whenever I add a new node it will be linked there and all data will be present there too.

But the problem is that I got an error `obtaining shard lock for [starting shard] timed out after [5000ms], lock already held for [closing shard] with age [286549ms]` so I'm thinking if it is not better to use separate volumes for each node.

But keep in mind, that the number of nodes can increase and decrease, but data should be persisted no matter what.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 15, 2022, 9:13am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483/2 "2022-09-15T09:13:16Z")

</div>

Have a look at [the recommendations around deploying Elasticsearch on AWS](https://www.elastic.co/guide/en/elasticsearch/plugins/8.4/cloud-aws-best-practices.html). As you can see it is not recommended to use EFS for Elasticsearch storage.

---

<div class="post-metadata">

**Author:** ![Dmitry\_Kulik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitry_kulik/32/105273_2.png) [@Dmitry\_Kulik](https://discuss.elastic.co/u/Dmitry_Kulik)\
**Post date:** [September 15, 2022, 9:32am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483/3 "2022-09-15T09:32:03Z")

</div>

Thanks, @Christian_Dahlqvist, I've checked it and understand that EFS is not the best solution, but I still can't get how to save all the data in case I use the Instance store. In case 1 instance will be terminated, where ES will take indices from?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 15, 2022, 9:39am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483/4 "2022-09-15T09:39:35Z")

</div>

In an Elasticsearch cluster shards are generally replicated, so even if you lose 1 node there is still a copy of the shard available. This can then be replicated so the cluster again holds 2 copies. You can use EBS volumes for storage and these are more resilient.

---

<div class="post-metadata">

**Author:** ![Dmitry\_Kulik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitry_kulik/32/105273_2.png) [@Dmitry\_Kulik](https://discuss.elastic.co/u/Dmitry_Kulik)\
**Post date:** [September 15, 2022, 9:51am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483/5 "2022-09-15T09:51:10Z")

</div>

Thanks a lot for your help @Christian_Dahlqvist

---

<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:** [October 13, 2022, 9:52am UTC](https://discuss.elastic.co/t/best-practice-of-using-volumes-across-a-cluster/314483/6 "2022-10-13T09:52:04Z")

</div>

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