all shards on single machine?
I have a problem with the balancing of a big sharded MongoDB system.
My current Setup:
1 big Collection with ~ 1.7G documents
7 Shards shard key: { "_id" : "hashed" }
~700 Chunks
Mongo DB Version : 2.4
The balancing of the chunks worked well , so each Shard has ~ 100 Chunks.
But the amount of documents on the 7 shards is very uneven.
The biggest has nearly 10 times more documents than the smallest one.
Many thanks for the helpful feedback.The Script from the link works out of the box without problems.Our system is a fresh system and we imported the last 14 Days a lot of data from our backup files.The Import finished some days ago, but it looks like the balancer has still a lot of work to do.
I found chunks with a lot more data than the expected 64 MByte.
And this is the reason for the uneven amount of documents.e.g. biggest chunk has 31 GByte, so this could be splitted into 484 new chunks with 64 MByte each.
use config;
db.chunks.find({jumbo:true});
Hello again,
here the answers to your questions:
- When you restored the data, how many mongos did you insert via?
We used just one mongorestore process for the loading of the data.
But our application was already active during this time, so one Mongos process wrote also all 10 min some data into the db.
So 99% of the data have been inserted from the same process.
- What exact version of MongoDB 2.4.x is this?
We are using 2.4.13
The update to Mongo 3 is already on the schedule, but not with the highest priority.
- Can you check if these chunks have been flagged as jumbo chunks (aka unsplittable):
We have no jumbo chunks right now. But I have seen several of them during the import process.
I am tracing the amount of chunks on every shard since last Friday, so I get a better understanding of the activities.
Friday 15:00 795 chunks ==> Monday 10:00 831 chunks
So the balancer is working, but it not very fast and midget need a very long time for the fixing of the problem.
The tracing of the amount of documents on each shard shows also an interesting effect.
The 2 big servers still grow faster than the other servers.
I think this works like gravity. The uneven Chunks with a too big range collect also a big part of the new data. And the balancer process is currently to slow to compensate it.
I will test a manual split as a first step, and if this isn't good/fast enough start with a fresh import.