putsreq icon indicating copy to clipboard operation
putsreq copied to clipboard

data loss?

Open ddavtian opened this issue 5 years ago • 4 comments

Hosting my own version locally and things are running as expected. After sending lots of traffic the web container stopped accepting traffic and to fix the issue I issued the following two commands

docker-compose down followed by docker-compose up

Containers came up but now it seems that the user I had created previously and all the buckets are gone. Is there a way to recover to perhaps a better way to approach this issue in the future as I had created many different buckets, etc.

Thanks

ddavtian avatar Jun 26 '19 15:06 ddavtian

Hey

You can try to update the docker-compose.yml to use a volume for MongoDB. In the way it is, it is supposed to map MongoDB to the filesystem ./tmp/db so even up & down should work. Is there any chance you've also deleted ./tmp?

phstc avatar Jun 26 '19 16:06 phstc

@phstc thank you for your response, no I didn't remove ./tmp/db, it's still there

ls -lah tmp/
total 24K
drwxr-xr-x  6 root root 4.0K Jun 16 15:21 .
drwxr-xr-x 13 root root 4.0K Jun 26 16:35 ..
drwxr-xr-x  4 root root 4.0K Jun 16 18:08 cache
drwxr-xr-x  2 root root 4.0K Jun 16 15:21 db
drwxr-xr-x  2 root root 4.0K Jun 26 05:25 pids
drwxr-xr-x  2 root root 4.0K Jun 16 15:21 sockets

Looking within the db directory it seems empty though

ddavtian avatar Jun 26 '19 16:06 ddavtian

Probably a different issue that warrants another thread but quite frequently I am seeing this when reading the logs from the web container after issuing docker-compose up

MONGODB | Connection refused - connect(2) for 172.23.0.3:27017
MONGODB | Connection refused - connect(2) for 172.23.0.3:27017

ddavtian avatar Jun 26 '19 17:06 ddavtian

Dear @ddavtian,

we experienced the same issue and then found [1] which explains it. We also summarized our production setup within https://github.com/phstc/putsreq/issues/68#issuecomment-621480576.

With kind regards, Andreas.

[1] https://stackoverflow.com/questions/53870416/data-does-not-persist-to-host-volume-with-docker-compose-yml-for-mongodb

amotl avatar Apr 29 '20 21:04 amotl