# Snapshot and restore using shared file system

**URL:** <https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [June 19, 2023, 12:27pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365 "2023-06-19T12:27:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sann](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Sann](https://discuss.elastic.co/u/Sann)\
**Post date:** [June 19, 2023, 12:27pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/1 "2023-06-19T12:27:24Z")

</div>

When using a cluster with more than one node is not enough to create local folders for shared fs repo. you need smb/nfs mounted drive because each node will check the "repo" and if there is no communication between nodes via the repo, then it will not work. if each node can not see data put by other nodes, then the repo will not be available. how?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 19, 2023, 12:34pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/2 "2023-06-19T12:34:32Z")

</div>

Hello and welcome,

> [@Sann](#):
>
> if each node can not see data put by other nodes, then the repo will not be available. how?

Not sure what is your issue, can you provide more context? It is not clear.

If you want to use a filesystem to store your snapshots, you need a shared filesystem that needs to be accessible in every data and master nodes, if the shared filesystem is not accessible in every data and master nodes of your cluster it will not work.

---

<div class="post-metadata">

**Author:** ![Sann](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Sann](https://discuss.elastic.co/u/Sann)\
**Post date:** [June 20, 2023, 9:17am UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/3 "2023-06-20T09:17:24Z")

</div>

Thank you for your response,

I had problem like I need to share my snapshots to my local system ,I tried it first with file sharing method but, it failed to allocate the file System in windows . Here I use yaml file to mount the volume but they denies the access from cluster(Eg:AccessDeniedException).

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 20, 2023, 12:13pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/4 "2023-06-20T12:13:46Z")

</div>

> [@Sann](#):
>
> Here I use yaml file to mount the volume but they denies the access from cluster(Eg:AccessDeniedException).

You need to share both your configuration and the log error you received.

---

<div class="post-metadata">

**Author:** ![Sann](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Sann](https://discuss.elastic.co/u/Sann)\
**Post date:** [June 21, 2023, 7:35am UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/5 "2023-06-21T07:35:57Z")

</div>

```auto

warning: ignoring JAVA_HOME=/opt/bitnami/java; using ES_JAVA_HOME
[2023-06-20T10:09:53,801][ERROR][o.e.b.Elasticsearch] [elasticsearch-data-0] fatal exception while booting Elasticsearch java.lang.IllegalStateException: Unable to access 'path.repo' (/opt/bitnami/elasticsearch/\\WINDOW-INST/elasticbackupath)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:66)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:252)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.Security.createPermissions(Security.java:178)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.Security.configure(Security.java:125)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:188)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:66)
Caused by: java.nio.file.AccessDeniedException: /opt/bitnami/elasticsearch/\\WINDOW-INST
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
        at java.base/java.nio.file.Files.createDirectory(Files.java:700)
        at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
        at java.base/java.nio.file.Files.createDirectories(Files.java:793)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:330)
        at org.elasticsearch.server@8.8.0/org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64)
        ... 5 more

ERROR: Elasticsearch did not exit normally - check the logs at /opt/bitnami/elasticsearch/logs/elastic.log

ERROR: Elasticsearch exited unexpectedly

```

---

<div class="post-metadata">

**Author:** ![Sann](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Sann](https://discuss.elastic.co/u/Sann)\
**Post date:** [June 21, 2023, 7:36am UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/6 "2023-06-21T07:36:31Z")

</div>

config  
given helm script value as nfs path  
@param snapshotRepoPath File System snapshot repository path  
ref: [containers/bitnami/elasticsearch at main · bitnami/containers · GitHub](https://github.com/bitnami/containers/tree/main/bitnami/elasticsearch)  
environment-variables

snapshotRepoPath: \WINDOW-INST/elasticbackupath

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 21, 2023, 11:25am UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/7 "2023-06-21T11:25:25Z")

</div>

> [@Sann](#):
>
> `[2023-06-20T10:09:53,801][ERROR][o.e.b.Elasticsearch] [elasticsearch-data-0] fatal exception while booting Elasticsearch java.lang.IllegalStateException: Unable to access 'path.repo' (/opt/bitnami/elasticsearch/\\WINDOW-INST/elasticbackupath)`

This is a little confusing and does not looks like a valid path.

You are running elasticsearch on linux, and this is not how you mount a windows share on linux, you need to mount it correctly, which is more an infrastructure issue than an elasticsearch one.

You need to mount your windows share on your linux machine and use this mount point as the path for your repository, for example, assume that you are mounting your windows share on `/mnt/snapshots`, this is the path you need to use in `path.repo`.

The way you did will not work.

How you will mount your windows share depends on your infrastrucutre, but normally on a linux machine you need to have `cifs-utils` installed and mount it in this way:

```auto
sudo mount -t cifs -o username=<win_share_user> //WIN_SHARE_IP/<share_name> /mnt/win_share

```

I'm not sure how this would work on kubernetes since I do not use it.

---

<div class="post-metadata">

**Author:** ![Sann](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Sann](https://discuss.elastic.co/u/Sann)\
**Post date:** [June 21, 2023, 12:17pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/8 "2023-06-21T12:17:58Z")

</div>

do I can mount them using yaml files sudo mount -t cifs -o username=\<win\_share\_user\> //WIN\_SHARE\_IP/\<share\_name\> /mnt/win\_share since i am trying to connect it with mylocal file system.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 21, 2023, 12:19pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/9 "2023-06-21T12:19:19Z")

</div>

> [@Sann](#):
>
> do I can mount them using yaml files sudo mount -t cifs -o username=\<win\_share\_user\> //WIN\_SHARE\_IP/\<share\_name\> /mnt/win\_share since i am trying to connect it with mylocal file system.

As I said, I'm not sure how you will do this, I do not use Kubernetes, but you need to fin a way to correctly mount this Windows Share on your Kubernetes Pods.

This is an infrastructure issue, not an Elasticsearch one.

---

<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 19, 2023, 12:19pm UTC](https://discuss.elastic.co/t/snapshot-and-restore-using-shared-file-system/336365/10 "2023-07-19T12:19:49Z")

</div>

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