I am running multiple mongoimport processes to import a collection into a mongo cluster. This collection is NOT sharded and its primary server is the shard-01 server.
Here is our sharding infrastructure:
shard-01-replica-set-01 with query-router-01
shard-01-replica-set-02
shard-02-replica-set-01 with query-router-02
shard-01-replica-set-02
There are 3 mongo import processes connecting to query-router-01 and 3 mongo import processes connecting to query-router-02.
When I tried to verify, I found out the collection size is different on query-router-01 and query-router-02. Then I found out 2 databases are created. One is created on shard-01 and another is created on shard-02. What is the issue?
Hi Angelo,
I am running multiple mongoimport processes to import a collection into a mongo cluster. This collection is NOT sharded and its primary server is the shard-01 server.
There are 3 mongo import processes connecting to query-router-01 and 3 mongo import processes connecting to query-router-02.
When I tried to verify, I found out the collection size is different on query-router-01 and query-router-02. Then I found out 2 databases are created. One is created on shard-01 and another is created on shard-02. What is the issue?
I’m not sure I fully understand the situation. My understanding so far is:
mongos
processes in your deploymentmongos
at the same timemongos
, there are 3 import processes (totalling 6 import processes overall)Is my understanding correct?
Could you please post:
mongo
shell script, tools such as mongorestore
, any script using some other language)mongodump
command lines)mongorestore
command lines)Best regards,
Kevin
mongos
at the same timemongo
shell script, tools such as mongorestore
, any script using some other language)mongodump
command lines)mongorestore
command lines)Hi,
I attempted to recreate your issue but so far had no success. I tried importing 30 collections using two different mongos
but so far only a single database was created, which contains all 30 collections imported from both mongos
.
No, I am importing different collections on different mongos. The reason I was doing this was to speed up the import process.
If you are trying to speed up the import process, you may want to take a look at the --numInsertionWorkers
parameter in mongoimport
. This setting defaults to 1, and increasing the number of insertion workers may increase the speed of your import.
Best regards,
Kevin