[root@host project]# mongo
2021-06-01T04:51:34.325+0200 F - [main] Failed to mlock: Cannot allocate locked memory. For more details see: https://dochub.mongodb.org/core/cannot-allocate-locked-memory: Operation not permitted
2021-06-01T04:51:34.325+0200 F - [main] Fatal Assertion 28832 at src/mongo/base/secure_allocator.cpp 255
2021-06-01T04:51:34.325+0200 F - [main]
***aborting after fassert() failure
Using Fedora in nspawn container.
Unfortunately the link is also broken.
Anyone has any suggestions?
I got a similar problem. I have a Debian nspawn container with Docker inside. The
mongoimage failed to launch becausemlocksystem calls were denied.I had the following configuration in my
/etc/systemd/nspawn/machine.nspawn:I solved my problem by adding
@memlocktoSystemCallFilter.In your case, if you don't have a
Capability=allline in yourmachine.nspawnfile, you need to have at leastCapability=CAP_IPC_LOCK.