KWriter
KWriter

Reputation: 1184

Running two Docker instances of Memgraph at the same time

I want to run to Docker instances of Memgraph at the same time. I want to have one that has persistence turned on so that I don't lose all of the data on each restart, and I want one where I will lose all of the data. I use the second one for quick tests so I don't mess up the version with actual data.

If I start and shut them down one by one everything is ok. But if try to start them at the same time I can not access the second one since all of the ports are already in use.

Is it possible to have two Docker instances of Memgraph up and running at the same time or should I use a combination of WSL and Docker images?

Upvotes: 0

Views: 197

Answers (1)

KWriter
KWriter

Reputation: 1184

If you didn't do any changes to default settings then both of your Memgraph Lab instances will try to use port 3000, but only one will be able to bind to it. You need to change the config of one of your Memgraph Platform instances and change it to 3001 or some other port. Here is what you need to do:

  1. Start the first instance with: docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 memgraph/memgraph-platform
  2. Start the second instance with docker run -it -p 7688:7687 -p 7445:7444 -p 3001:3000 memgraph/memgraph-platform

You have said that you use persistence so don't forget to add those parameters to your start-up command.

Upvotes: 1

Related Questions