# NFS - Gateway FS index storage

**URL:** <https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592>\
**Category:** Elasticsearch\
**Created:** [November 7, 2012, 3:32am UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592 "2012-11-07T03:32:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryanb](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@bryanb](https://discuss.elastic.co/u/bryanb)\
**Post date:** [November 7, 2012, 3:32am UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592/1 "2012-11-07T03:32:38Z")

</div>

I need help configuring an elastic search cluster. I would like to have the  
index shared between to nodes via an NFS mount.

I have set the gateway.fs.location property to the NFS destination and I  
see a directory is created for the cluster with indices and metadata as  
subfolders. This looks okay.

However, it appears the directory specified in the path.data property also  
contains an index. I didn't expect the path.data directory to also contain  
the index. Why are there two copies of the index?

--

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [November 7, 2012, 7:18am UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592/2 "2012-11-07T07:18:58Z")

</div>

BryanB wrote:

> I need help configuring an Elasticsearch cluster. I would like to  
> have the index shared between to nodes via an NFS mount.
> 
> I have set the gateway.fs.location property to the NFS destination  
> and I see a directory is created for the cluster with indices and  
> metadata as subfolders. This looks okay.
> 
> However, it appears the directory specified in the path.data  
> property also contains an index. I didn't expect the path.data  
> directory to also contain the index. Why are there two copies of  
> the index?

Gateways are a way for ES to asynchronously snapshot cluster data to  
a central location for easy restoration. But as long as you're using  
filesystem-based index storage (as opposed to RAM-based), path.data  
will always contain your index data too.

If you're starting more than one node in a particular path.data, ES  
will create more node-level subdirectories so they don't conflict,  
e.g., 0/, 1/, etc. I know this works with multiple nodes running on  
the same machine, but I haven't tried it with different machines  
accessing the same volume. In theory you should be able to stick  
with local gateway and point path.data at the NFS mount and keep only  
one copy of your data.

Unfortunately, this also comes with a cost of now not only having to  
hit the disk, but do it over the network with other machines  
contending for the same resource.

-Drew

--

---

<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:** [November 7, 2012, 7:22am UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592/3 "2012-11-07T07:22:55Z")

</div>

Hi Bryan,

Why do you want to share indexes with NFS?  
Do you think that you _must_ do it or is it a disk space concern?  
Beware of IO when storing indexes on a network FS.

That said, documentation says that SharedFS is used to store ES metadata (replace path.work)  
That means that your index will always be written in path.data.

See: [http://www.elasticsearch.org/guide/reference/modules/gateway/fs.html](http://www.elasticsearch.org/guide/reference/modules/gateway/fs.html)

My 2 cents

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

Le 7 nov. 2012 à 04:32, BryanB [bryan.bringle@gmail.com](mailto:bryan.bringle@gmail.com) a écrit :

I need help configuring an elastic search cluster. I would like to have the index shared between to nodes via an NFS mount.

I have set the gateway.fs.location property to the NFS destination and I see a directory is created for the cluster with indices and metadata as subfolders. This looks okay.

## However, it appears the directory specified in the path.data property also contains an index. I didn't expect the path.data directory to also contain the index. Why are there two copies of the index?

--

---

<div class="post-metadata">

**Author:** ![bryanb](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@bryanb](https://discuss.elastic.co/u/bryanb)\
**Post date:** [November 8, 2012, 1:51pm UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592/4 "2012-11-08T13:51:35Z")

</div>

The NFS was a constraint added by our admins. That constraint has been  
removed and local storage has been allocated on each node for index  
storage. I still have the NFS mount available. Should I use the NFS as a  
gateway FS? Our ES deployment is relatively simple. All of our indexed data  
is backed by a database. We have a job to rebuild and swap the index using  
aliasing is something goes wrong.

On Wednesday, November 7, 2012 2:34:46 AM UTC-5, Drew Raines wrote:

> BryanB wrote:
> 
> > I need help configuring an Elasticsearch cluster. I would like to  
> > have the index shared between to nodes via an NFS mount.
> > 
> > I have set the gateway.fs.location property to the NFS destination  
> > and I see a directory is created for the cluster with indices and  
> > metadata as subfolders. This looks okay.
> > 
> > However, it appears the directory specified in the path.data  
> > property also contains an index. I didn't expect the path.data  
> > directory to also contain the index. Why are there two copies of  
> > the index?
> 
> Gateways are a way for ES to asynchronously snapshot cluster data to  
> a central location for easy restoration. But as long as you're using  
> filesystem-based index storage (as opposed to RAM-based), path.data  
> will always contain your index data too.
> 
> If you're starting more than one node in a particular path.data, ES  
> will create more node-level subdirectories so they don't conflict,  
> e.g., 0/, 1/, etc. I know this works with multiple nodes running on  
> the same machine, but I haven't tried it with different machines  
> accessing the same volume. In theory you should be able to stick  
> with local gateway and point path.data at the NFS mount and keep only  
> one copy of your data.
> 
> Unfortunately, this also comes with a cost of now not only having to  
> hit the disk, but do it over the network with other machines  
> contending for the same resource.
> 
> -Drew

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [November 9, 2012, 10:52am UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592/5 "2012-11-09T10:52:42Z")

</div>

Hello Bryan,

On Thu, Nov 8, 2012 at 3:51 PM, BryanB [bryan.bringle@gmail.com](mailto:bryan.bringle@gmail.com) wrote:

> The NFS was a constraint added by our admins. That constraint has been  
> removed and local storage has been allocated on each node for index storage.  
> I still have the NFS mount available. Should I use the NFS as a gateway FS?

I would only use NFS gateway in your situation if the local storage is  
so unreliable that replicas wouldn't be enough to ensure I don't lose  
data. Local Gateway is usually the way to go, not only for  
performance, but also because it's what most users have, so it's the  
more proven (see "tested" :p) way.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<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, 3:05am UTC](https://discuss.elastic.co/t/nfs-gateway-fs-index-storage/9592/6 "2017-07-06T03:05:11Z")

</div>


