Split Mongo data into more than one folder. Possible?

Asked

Viewed 91 times

1

I have mongodb running on a 500GB primary drive. As the base started to grow a lot, I put a 1TB slave disk and changed to it the folder date. I know that in time, this 1TB record will also be little.

I wonder if there is a possibility to put a third disk and make Mongo also use it to store data. In other words, in my design Mongo would use disks 2 and 3 and divide the data load between them. My question to the learned is: does it exist? Is it possible?

I’ve researched the concept of sharding, and I’ve even understood it. But in shardind, I would divide the data between two machines, that is, between two instances of mongodb. It’s an option I have to use as a last resort.

But before going to sharding, I would still like to know if it is possible in the same instance to split the data between two different folders (which will be on different disks).

Thank you for any information.

1 answer

0

There are some ways you can do this, if you want to use sharding but don’t have a new machine, you can have two or more instances of mongod running on the same machine, each with a different dbpath. Or else you can enable the Storage.directoryPerDB option, which will cause each database to have its own subdirectory within the dbpath path and mount the directories pointing to its disk drives.

More information on: https://docs.mongodb.com/manual/reference/configuration-options/#Storage.directoryPerDB

  • I thought another possibility: use the option directoryPerDB and have the Databases and folders separate. Then I would move the folders of some Databases to another disk and inside the DB I would create shortcuts, pointing to the real folders that will be on the other disk. Might work?

  • I honestly don’t know, I’ve never tested this solution, but I think it’s worth a try.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.