1

I've found the question that explains that it is possible to run two Memgraph instances at the same time when you are using Docker.

I've used the commands from that answer to run the instances:

  • Fist instance: docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 memgraph/memgraph-platform

  • Second instance: docker run -it -p 7688:7687 -p 7445:7444 -p 3001:3000 memgraph/memgraph-platform

This works OK.

I've modified this commands so that I would have data persistence. First instance runs ok, second one is not brought up; mgconsole is not shown. I don't see any errors.

  • Fist instance: docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -v mg_lib:/var/lib/memgraph memgraph/memgraph-platform

  • Second instance: docker run -it -p 7688:7687 -p 7445:7444 -p 3001:3000 -v mg_lib:/var/lib/memgraph memgraph/memgraph-platform

What causes this?

GrandMel
  • 157
  • 8
  • 1
    They probably need different storage as well; does it help to change the volume name (before the colon) in one of the `-v` options? – David Maze Apr 03 '23 at 09:51
  • @david Maze you are right. I need to use different -v options. I'll write an answer now. – GrandMel Apr 03 '23 at 14:31

1 Answers1

2

When running two Docker instances at the same time besides different port numbers it is important to use different volumes for data persistance. The correct commands would be:

docker run -it -p 7687:7687 -p 3000:3000 -p 7444:7444 -v mg_lib:/var/lib/memgraph memgraph/memgraph-platform

docker run -it -p 7688:7687 -p 3001:3000 -p 7445:7444 -v mg_lib2:/var/lib/memgraph memgraph/memgraph-platform
GrandMel
  • 157
  • 8