1

I will visit a client's industry location for a few hours and have to copy the data from his mongoDB server. The data is currently above 800gb in size. I tried to replicate the data remotely but it is very slow, and hence I will visit the physical location to clone the data. Few options I found are LVM, mongodump, mongoexport, and until now LVM seems the best option. Is there a js query that can solve this situation or what might be the best course of action for this? Thanks.

6
  • What is the operating system? It seems to be Linux. Commented Oct 9, 2019 at 17:58
  • Yes it is Linux. Commented Oct 9, 2019 at 17:59
  • What distribution? and which version? Commented Oct 9, 2019 at 18:01
  • I am not sure. I will only get to know when I am there. Is there a generic solution where the distribution and version does not matter? Commented Oct 9, 2019 at 18:03
  • You need to know if the data is on LVM. Also you need to know if you need to copy the data online, or you can take the volume offline. Commented Oct 9, 2019 at 18:11

1 Answer 1

1

Make a mirror partition or disk as a LVM PV (physical volume) and make sure both are in sync. Then just take out one of the disks with you.

Before doing any changes in production, experiment with 2 VMs. One that is the "local VM" and another that is "client VM". Have a disk volume that you detach from the first VM with the mirror, then attach it to the 2nd VM. Document all steps and all troubleshooting steps.

By LVM I mean Linux device mapper based Logical Volume Manager

If the mongodb data is not on LVM, or speed is most important limiting factor and you can take the disks offline, you can:

  • stop all services using any partition/volume from the volume you want to mirror
  • unmount all partitions from the disk you need to copy or at least the mongodb one
  • copy using dd if=/dev/sdX of=/dev/sdY, where sdX is the source disk and sdY is the destination disk. Make sure you understand the dd command and what a block device is before using it blindly.
6
  • I have an external hard drive that I will take with me to the location. And I will have a few hours in my hand. Will this time be enough to make the mirror partition LVM ? Commented Oct 9, 2019 at 18:05
  • You need USB3.0 but, if possible, take the disk out of enclosure and attach it to a SATA interface. It should take be enough 2h, but depends on a lot of factors. Also check --minrecoveryrate option. Commented Oct 9, 2019 at 18:10
  • access.redhat.com/documentation/en-us/red_hat_enterprise_linux/… Commented Oct 9, 2019 at 18:10
  • Thank you very much. Commented Oct 9, 2019 at 18:15
  • Yes we can take the disks offline during that time as it will be closed hours. I think unmounting and copying the data would be the best option. Commented Oct 9, 2019 at 18:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.