简体   繁体   English

在具有不同MongoDB版本的2个Docker容器中共享MongoDB

[英]Share MongoDB across 2 Docker containers having different MongoDB versions

Already a fully-fledged mongo v3.2 instance with data is running on a container. 已经有一个完整的mongo v3.2实例,数据正在容器上运行。

I need to create a mongo v3.6 container instance with the same data as v3.2. 我需要使用与v3.2相同的数据创建一个mongo v3.6容器实例。

I do not have space to clone the data on the server. 我没有空间来克隆服务器上的数据。

I tried a lot of stuff. 我尝试了很多东西。

Can I point to the data of the v3.2 from my v3.6 so that it is shared and I save space? 我可以从我的v3.6指向v3.2的数据,以便共享它并节省空间吗?

You can try this. 你可以试试这个。 Don't know if it would work(because of different versions of mongodb). 不知道它是否会起作用(因为mongodb的版本不同)。

You can create a sharded cluster and add your old DB as a shard. 您可以创建分片群集并将旧数据库添加为分片。

I got the space cleared. 我把空间清理干净了。

Got the dump and made a new instance of mongo. 获得了转储并创建了一个mongo的新实例。

It works like a charm now. 它现在就像一个魅力。

The sharing volume was corrupting the data. 共享卷正在破坏数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM