memgraph not persisting
goodrahstar
HOBBYOP

2 months ago

i'm running memgraph from docker image - 'abhyudaypatel/memgraph-ipv6' through internal networking.
railway is not supporting docker volumes, but when i'm mounting railway volumes to 'var/lib/memgraph', its showing this and crashing.
"Max virtual memory areas vm.max_map_count 65530 is too low, increase to at least 262144"

the memgraph memory is also full but when i'm increasing it from dockerimage, its showing the same error and crashing.

any solution? asap

$10 Bounty

5 Replies

domehane
FREE

2 months ago

I think railway doesn’t let you raise the host vm.max_map_count (it’s a kernel setting), so memgraph won’t run with a mounted volume there , you need vm.max_map_count>=262144.

options you have: run memgraph on a VPS/VM or k8s where you can sysctl -w vm.max_map_count=262144, use memgraph cloud/another managed graph db, or as a temporary hack run without

mounting /var/lib/memgraph (in-memory only , data lost on restart)


domehane

I think railway doesn’t let you raise the host vm.max_map_count (it’s a kernel setting), so memgraph won’t run with a mounted volume there , you need vm.max_map_count>=262144.options you have: run memgraph on a VPS/VM or k8s where you can sysctl -w vm.max_map_count=262144, use memgraph cloud/another managed graph db, or as a temporary hack run withoutmounting /var/lib/memgraph (in-memory only , data lost on restart)

goodrahstar
HOBBYOP

2 months ago

I also got into this conclusion, but was thinking of way to not migrate for now and just save data


goodrahstar

I also got into this conclusion, but was thinking of way to not migrate for now and just save data

domehane
FREE

2 months ago

so mounted volumes + memgraph persistence won’t work. quick workable hack to avoid migrating now:

  1. run memgraph without mounting /var/lib/memgraph (ephemeral)

  2. periodically export while it’s up:

    • using mgconsole: dump database;orcreate snapshot;

    • or via mage: call export_util.cypher_all('/tmp/export.cyp'); or call export_util.json('/tmp/export.json');

  3. immediately upload the dump/snapshot off-instance (aws s3, http endpoint, git, etc.) , automate this with a tiny script/cron in the container or an external job that calls the export endpoint and pushes to s3

  4. to restore: start memgraph elsewhere (or a new instance) and run the cypher file or load the snapshot

those are short term backup-only solution , for real persistence move to a host where you can sysctl -w vm.max_map_count=262144 or use memgraph cloud


domehane
FREE

2 months ago

feel free to reach out if you need further clarification


ironpee-thai
FREE

2 months ago

Ok


Loading...