Snapshot Backup while using Docker

Hey All,

I am running a three node elasticsearch cluster using docker.

Here is the elasticsearch.yml file of the master node :-
discovery.zen.minimum_master_nodes: 1
node.master: true false
http.cors.enabled : true
http.cors.allow-origin : "*"
path.repo: ["/tmp","/tmp/es-backup"]

And here is the same for the data nodes :-
discovery.zen.minimum_master_nodes: 1 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/

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.

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.

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