I am trying to move Mongodb server (single) instance from a server running AWS Linux to another server running Debian 9 "Stretch". It contains 100 million odd documents across 80k collections. Everything is running smoothly on AWS Linux, however, the script that is transferring data keeps getting the error -
pymongo.errors.WriteError: 24: Too many open files - after 500k or so documents are transferred.
I have tried adjusting ulimit settings, but it still keeps throwing the same error.
Following are the limits on both servers -
AWS
ulimit -Hn = 4096
ulimit -Sn = 1024
Debian 9
ulimit -Hn = 999999
ulimit -Sn = 999999
Also, worth mentioning - I am using the "official" MongoDB Community Edition package on AWS Linux (installed using the documentation provided by MongoDB), while on Debian, installed included package.