# Snapshot Backup while using Docker

**URL:** <https://discuss.elastic.co/t/snapshot-backup-while-using-docker/90819>\
**Category:** Elasticsearch\
**Created:** [June 26, 2017, 11:38am UTC](https://discuss.elastic.co/t/snapshot-backup-while-using-docker/90819 "2017-06-26T11:38:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_here](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@newbie\_here](https://discuss.elastic.co/u/newbie_here)\
**Post date:** [June 26, 2017, 11:38am UTC](https://discuss.elastic.co/t/snapshot-backup-while-using-docker/90819/1 "2017-06-26T11:38:50Z")

</div>

Hey All,

I am running a three node elasticsearch cluster using docker.

Here is the elasticsearch.yml file of the master node :-

network.host: 0.0.0.0  
discovery.zen.minimum\_master\_nodes: 1  
node.master: true  
node.data: false  
http.cors.enabled : true  
http.cors.allow-origin : "\*"  
path.repo: ["/tmp","/tmp/es-backup"]

And here is the same for the data nodes :-

network.host: 0.0.0.0  
discovery.zen.minimum\_master\_nodes: 1  
node.data: true  
http.cors.enabled : true  
http.cors.allow-origin : "\*"  
path.repo: ["/tmp","/tmp/es-backup"]

After the whole cluster is set up, I try to create a repository , using the command :-  
PUT \_snapshot/testing/  
{"type":"fs","settings":{"location":"/tmp/es-backup"}}

But I get the error that the slave nodes are not able to access the '/tmp/es-backup' folder of the master.  
But somehow the repository had been created as I could see from the command  
GET \_cat/repositories  
And also the snapshot of backup of indices were done, I couldn't restore any of the snapshot backup,  
there weren't any error shown, but the shards were still unallocated after 10-12 minutes.

So, afterwards I mount the '/tmp/es-backup' folder inside each of the docker containers to one common shared drive via the command

sshfs root@xxx.xx.xx.x:/shareddata/backup /tmp/es-backup

Note: I have mounted the '/tmp/es-backup' folder of each node to the same folder.

But after trying to create the repository in this scenario, I end up with the error, that the files already exist. Find the error in detail below :-

{  
"error": {  
"root\_cause": [  
{  
"type": "repository\_exception",  
"reason": "[new\_backup] failed to create repository"  
}  
],  
"type": "repository\_exception",  
"reason": "[new\_backup] failed to create repository",  
"caused\_by": {  
"type": "file\_already\_exists\_exception",  
"reason": "/tmp/es-backup"  
}  
},  
"status": 500  
}

Please any help in regards as to how to create a snapshot backup while using docker to create an elasticsearch cluster would be helpful.

---

<div class="post-metadata">

**Author:** ![newbie\_here](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@newbie\_here](https://discuss.elastic.co/u/newbie_here)\
**Post date:** [June 30, 2017, 10:53am UTC](https://discuss.elastic.co/t/snapshot-backup-while-using-docker/90819/2 "2017-06-30T10:53:48Z")

</div>

I found the solution to this.

I was facing the error because I was using sshfs for mounting the shared folders of the repository locations and hence the slaves were just replicating the master repository folder.

After using a NFS shared directory, there were no issues faced.

---

<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 28, 2017, 10:53am UTC](https://discuss.elastic.co/t/snapshot-backup-while-using-docker/90819/3 "2017-07-28T10:53:55Z")

</div>

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