L
L
LayneBuchyn2013-08-22 23:50:45
linux
LayneBuchyn, 2013-08-22 23:50:45

Use one database from multiple mongod processes

Hello.
I'm not very good at mongo and I had a problem with write-read locks, which made working with the database extremely slow and unbearable.
Having googled and smoked the MongoDB documentation on Concurrence in a quick way, I roughly understood that you can somehow run several mongod instances, and in one instance, for example, perform write operations, in another, read operations.
Is it possible to do this without creating a Replica Set?
I imagine it like this:
mongod --fork --port 27018
mongod --fork --port 27019
mongod --fork --port 27020

But instances are only launched with a separate dbpath, so the target database in other instances is empty.
Is it possible to somehow use the same database from multiple mongod instances without constantly copying it?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2013-08-23
@LayneBuchyn

will not work, because the same resource will be used (well, that is, it’s impossible). I significantly improved the situation by spreading the collections across different databases (the database is locked, not the server). in application I specify not a collection and base.collection every time. But if you have a load on one collection, then this will not help

S
sevmax, 2013-08-23
@sevmax

No. They, most likely, will not even post, because the first process will lock the database for itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question