Can't add replica set to PRIMARY node

I am not docker savvy but I think that you cannot use localhost for your replica set.

I think that each docker instance has a separate address space and that localhost on one docker instance refers to itself not to the host localhost. You would need to setup the replica set using the IP address of each docker instance.

You may access localhost:27017 from the main host because the port 27017 is redirected to a given docker instance.

1 Like