I have a MongoDB replica set of 3 instances running and recently I got the following errors in the log file:
error: hashtable namespace index max chain reached:1335
warning: hashtable namespace index long chain
ERROR: writer worker caught exception: too many namespaces/collections on: ...
This looks to me like the default .ns (namespace file) size limit isn't enough here so I included:
nssize = 32
to the configuration of each replica set member.
This is supposed to make the namespace files 32MB now instead of default 16MB (see http://docs.mongodb.org/manual/reference/configuration-options/#storage.nsSize).
Questions:
How do I rebuild the existing namespace files to have the new limit taken into account? Restarting mongod server didn't seem to work.
You will need to recreate your database in order for this to take effect until: https://jira.mongodb.org/browse/SERVER-385 is around.
Is there anything else I should do apart from changing this limit to get rid of such errors?
Not really, other than make it bigger than 32MB?
For reference here is 10gen talking about the error: https://groups.google.com/forum/#!topic/mongodb-user/YrPqM85N4Mk and what to do, they essentially come to the same conclusion as you have: watch the number of collections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With