While trying to migrate an Infrastructure away from Amazon (their service is not at all that cheap) to a container based one @Wable (good offer and they "swear" they'll never over-commit), one of the components failed - it was a Couchbase server.
Let's follow the process (and the debug):
$ dpkg -i couchbase-server-community_2.2.0_x86_64.deb
...
Setting up couchbase-server (2.2.0) ...
* Failed to start couchbase-server: timed out
dpkg: error processing package couchbase-server (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
couchbase-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Somewhere in the logs /opt/couchbase/var/lib/couchbase/logs/info.1
: "load_failed, Failed to load NIF library: '/opt/couchbase/lib/erlang/lib/crypto-2.0.4/priv/lib/crypto.so: failed to map segment from shared object: Cannot allocate memory'"
Googled a bit the error, got some hints to check the container limits:
$ cat /proc/user_beancounters | egrep 'fail|locked'
uid resource held maxheld barrier limit failcnt
lockedpages 0 2048 2048 2048 27258
Opened a ticket with Wable, limits were raised fast (no questions asked), then:
$ cat /proc/user_beancounters | egrep 'fail|locked'
uid resource held maxheld barrier limit failcnt
lockedpages 0 2048 2560000 2560000 27258
That's it, now I can retry the install.