MongoDB: Mongoimport server selection error , connection refused, too many files open
Depending on your OS, there's multiple ways to modify the maxopenfile of MongoDB.
On Debian and Ubuntu, in /lib/systemd/system/mongod.service there's the LimitNOFILE argument which can be increased if needed.
You have more infos on other OS on https://docs.mongodb.com/manual/reference/ulimit/