1

So I have 2 sharded clusters with 3 servers each.My mongos is running, my config server is running and ive also added test data to 1 of the 2 shard clusters. I am having trouble getting that data to migrate to the other cluster... While looking at the logs im seeing [Balancer] no available shards to take chunks .... and..... distrubted lock 'balancer/Replica4/27017 : unlocked.....the maxSize on both of the clusters are at 125 not sure what else I should be looking at to remedy problem.. Any suggestions???

Also while checking the collections I noticed that it created the db but all of them are marked as (empty) ... On shard 2 all data exist ## shard 2 is the node that the data was loaded on.

secure212
  • 228
  • 1
  • 3
  • 10

1 Answers1

0

The basic answer here is: don't use maxSize with such a low value, it is not a precision setting. It relies on the mem.mapped value to determine the size, and that value is simply the size of all data files that have had mmap() called on them. In fact, until you have a better idea of your mapped sizes I would recommend turning it off altogether.

To explain: Data file sizes for databases start at 64MB, then double for each allocation thereafter by default up to the 2GB maximum. Combine that with the fact that MongoDB will allocate a 128MB file (for a total of 192MB) once you have inserted a single piece of data into the 64MB data file (by default, MongoDB keeps an empty data file pre-allocated to avoid delays with write heavy workloads). Then there is the likelihood that you have more than one database (an oplog in the local database for example) and you have essentially made sure that with that 125MB limit, all of your shards will be considered "full" almost immediately.

Remove the maxSize option, determine your actual data usage, and then add a sensible buffer (at least the size of an empty data file) if you want to use it in the future, but be aware that you can end up right back in the same scenario if you use more space than you expect.

Adam C
  • 5,222
  • 2
  • 30
  • 52