MongoDB - Killed when database disk is full I'm using MongoDB 3.6.5 (already tested on 3.2 / 3.4) and i have enabled "directoryPerDB" in /etc/mongo.conf.

#mongod.conf

storage:
   dbPath: /var/lib/mongodb
   journal:
     enabled: true
   directoryPerDB: true


I created LVM disk's for my databases and symlinked in to /var/lib/mongodb

Here is problem: 

When one of these lvm's is full, it will kill mongod service, so i can't use the rest of databases, where is free space on storage. Because of that, this will kill my primary node and subsequently the secondary node.

Is there some way to deal wiith it ? 

Your help will be greatly appreciated!
As at MongoDB 4.0, the overall contents of the dbPath for a deployment are integral irrespective of the directoryPerDB setting. For example, a replica set member maintains a shared oplog (operation log) with a rolling record of write operations to all databases in a deployment. All members of a replica set must have a common data history: it is currently not safe for a replica set member to continue writing data (or ignore some writes) that will cause divergence from other members of the replica set.

If there is insufficient free space for updates to be committed to disk, the affected mongod process will shut down assuming administrative intervention is required to free up additional space.


  Is there some way to deal wiith it ?


Ideally you should have monitoring in place to proactively warn about low free disk space before this becomes a critical issue. Running out of disk space is generally not a great scenario for applications (or operating systems) to recover from automatically.

Although not specific to MongoDB, some admins create "bumper files" which can provide a buffer in case emergency space is needed. For example, creating a 5GB file on each volume which can be removed to provide free space as disk usage is approaching  full (assuming you have monitoring in place so this action can be taken before disk reaches 100% usage).

If you are less concerned about the availability of some databases, you could also manage them as separate MongoDB deployments so they do not impact write availability for more critical data. However, this may be be adding unnecessary complexity versus a single deployment with appropriate monitoring.