# Snapshot/restore metadata file access

**URL:** https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581
**Category:** Elasticsearch
**Created:** [December 18, 2015, 2:30pm UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581 "2015-12-18T14:30:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Swedeski](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Swedeski](https://discuss.elastic.co/u/Swedeski)
#### Post date: [December 18, 2015, 2:30pm UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581/1 "2015-12-18T14:30:39Z")

</div>

Hello -

I have two clusters set up with dedicated master nodes and data nodes. With cluster A running in one data center and cluster B running in another data center. There is NAS storage mounted to the master and data nodes that will be used as the backing store for the snapshot/restore process.

From what I understand, during the snapshot/restore process, the master nodes create/read/write the **metadata-** and **snapshot-** files and the data nodes create/read/write the index files.

My question is, do the data nodes ever read/write anything to/from the **metadata-** and **snapshot-** files either during the snapshot or restore process? Or, are those **metadata-** files only read/written to by the master nodes?

I ask, because I have a need to provide encryption of the index files at rest due to the nature of the data stored in the cluster. I am ultimately wondering if I can apply the encryption only to the files written by the data nodes or whether I will need to use the same encryption techniques on the master nodes as well so that the data nodes can read the **metadata-** and **snapshot-** files.

Regards,  
Chris

---

<div class="post-metadata">

### Author: ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)
#### Post date: [December 18, 2015, 5:15pm UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581/2 "2015-12-18T17:15:15Z")

</div>

The elected master node is the only node that can modify the metadata, what we usually call cluster state. Any node can trigger a cluster state update (e.g. index creation), but that request will always be rerouted to the elected master node, which executes cluster state updates sequentially. After each update the new cluster state will be pushed to all of the nodes in the cluster. To wrap it up, each node holds the cluster state, but only the master modifies it.

With that I am not sure this answers your question 100%, maybe it will help expanding it so we can better answer it?

Cheers

---

<div class="post-metadata">

### Author: ![Swedeski](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Swedeski](https://discuss.elastic.co/u/Swedeski)
#### Post date: [December 18, 2015, 7:01pm UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581/3 "2015-12-18T19:01:20Z")

</div>

javanna thanks for the response.  
Wasn't quite the answer I was looking for. In particular, when I perform a snapshot on my cluster I get the following folders/files created on my shared NAS:

user1@xxxxxxx:/elasticsearch/backup/app1/indices/index1\> ls -ltrtotal 20-rw-rw-rw- 1 user1 user1 7709 Dec 17 17:43 snapshot-audit-12\_17\_2015t17\_43\_35\_165013129drwxrwsrwx 2 user1 user1 4096 Dec 17 17:44 2drwxrwsrwx 2 user1 user1 4096 Dec 17 21:48 0drwxrwsrwx 2 user1 user1 4096 Dec 17 22:31 1

The snapshot-\* file contains the following information:  
{"index1":{"version":12,"state":"open","settings":{"index.creation\_date":"1447974957071","index.uuid":"CsQKGpzpRkCxG4ObyhKaJQ","index.version.created":"1070299","index.number\_of\_replicas":"1","index.number\_of\_shards":"3"},"mappings":[{"RedactionType":{"properties":{"action":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"auditId":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"customerStorageId":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"matterId":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"modifiedByDataRoomContactId":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"modifiedByFirstName":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"modifiedByFullName":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"modifiedByLastName":{"type":"string","fields":{"raw":{"type":"string","index":"not\_analyzed","doc\_values":true}}},"modifiedByUserSessionId":{"type":"string","fields":{

Which node types (master / data) are allowed to write to the "snapshot-audit-12\_17\_2015t17\_43\_35\_165013129" file?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 19, 2015, 6:03am UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581/4 "2015-12-19T06:03:34Z")

</div>

Any and all nodes that have data pertaining to the index write to the files.

---

<div class="post-metadata">

### Author: ![Swedeski](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Swedeski](https://discuss.elastic.co/u/Swedeski)
#### Post date: [December 21, 2015, 12:26pm UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581/5 "2015-12-21T12:26:15Z")

</div>

Thank you very much, this helps.

---

<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 5, 2017, 11:29pm UTC](https://discuss.elastic.co/t/snapshot-restore-metadata-file-access/37581/6 "2017-07-05T23:29:34Z")

</div>


