Search code examples
memgraphdb

Failed to start key/value store when setting up Memgraph using Docker and mounting to a different disk


I am attempting to set up Memgraph using Docker, and I want to mount my mount point inside Docker to store the data on a different disk from where Docker is installed. However, whenever I try to do this, it fails to start and I receive the warning "Failed to start key/value store."


Solution

  • Change the default location of the Docker data directory is solution for this problem. The Docker daemon has a --data-root property that can be used to specify a different location for storing data.

    Steps for chaining it are:

    1. Stop the Docker service.
    2. Edit the Docker service file and add the --data-root property with the desired location.
    3. Restart the Docker service.

    More information about the --data-root property can be found in the official Docker documentation. There is also related discussion on how to change the default location for Docker volumes here on Stack Overflow.

    It's recommended to use named volumes instead of bind volumes with Memgraph. Named volumes provide a way to manage the data without worrying about the underlying file system path.