cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

Recreating the docker-compose cluster results on collections loss using external MongoDB

Open jfalameda opened this issue 4 years ago • 5 comments

Hi,

I am running the CMS on a docker-compose cluster. I use both external buckets and an Atlas DB mongo that has nothing to do with the cluster.

If I create some collections and then I rebuild the cluster (docker-compose up --build) the collections are not listed any more on the CMS or the API. I can still see the collections on the DB. I rollback the DB backup the collections won't return either. Login and other information are not corrupted.

This is extremely dangerous as It can mean a simple command would delete all my collections with no possibility for recovering. Any idea of what could be causing this and how to prevent it?

v. 0.10.0

Thanks, José.

jfalameda avatar Mar 31 '20 11:03 jfalameda

I think I'm seeing the same issue while trying to make a cluster deployment (with or without docker-compose). I have the CloudStorage (S3) addon and MongoDB. My observations:

  • Add an asset in one node then launch another node, the asset is listed in the 2nd node
  • Add a collection in one node then launch another node, the collection isn't listed in the 2nd node
  • Looked in the storage/data/collection directory on the 1st node, there's a file containing metadata for the collection.

... So it seems to be using the disk instead of mongo to store metadata for collections. Is this intentional? Is there a configuration setting that enables the collection data to write to the external database?

Thanks!

defrankland avatar Jul 15 '20 14:07 defrankland

Same problem here. I am using Docker for Cockpit and Mongo. It's weird because I can see my collections and their entries in the Mongo database but I cannot see them on cockpit if I recreate a new container.

I am sure that mongo has persistent data since the different accounts created on Cockpit are saved and displayed on the cockpit panel, it's just for the collections.

Anyone else with this issue ?

Thanks

K0WALSKl avatar Dec 20 '21 19:12 K0WALSKl

The collection definitions are stored in the filesystem and needs to be volume mapped to be persisted and shared between containers when running in docker

Oh that's why ! Thank you very much :)

Edit : You saved my day @fredrikkarlsson-pervanovo !!

K0WALSKl avatar Dec 20 '21 19:12 K0WALSKl

so it's impossible to run cockpit stateless in docker, correct?

the environment I'm planning to run cockpit on does not allow mount/attach volumes

rafaelss avatar Feb 15 '22 21:02 rafaelss