1

I'm running MongoDB on one computer and want to connect to the server instance from another computer on the same network.

Going into Mongo shell gives me the following output for both computers: connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb with a different instance: Implicit session: session { "id" : UUID(...) }.

I tried the proposed solutions from here and here to no avail. Thought that binding the IP to 0.0.0.0 would help, but it didn't.

Any additional suggestions from someone who dealt with a similar issue?

mmz
  • 1,011
  • 1
  • 8
  • 21

1 Answers1

0

0.0.0.0 is an address, not a port. You need to configure the server to listen on all addresses or explicitly on loopback (127.0.0.1) and the network address (whatever it is), then configure the client to connect to the server's address.

Use netstat on the server side to verify the server is listening on your configured addresses.

D. SM
  • 13,584
  • 3
  • 12
  • 21
  • firstly, fixed the typo, thanks. Secondly, could you opine? I set `bindIp: 127.0.0.1, 100.12.177.51` in the `mongod.conf` file, where the latter is my public IP. But I'm not sure what you mean by "configure the client to connect to the server's address." Does that mean changing something on the other computer's `mongod.conf` file? – mmz Mar 27 '21 at 18:16
  • This is shown in https://stackoverflow.com/questions/59996643/expose-mongodb-instance-within-the-local-network-with-windows-server – D. SM Mar 28 '21 at 11:59
  • 1
    The link you posted is perfect. That solved my problem. Appreciate the help on this – mmz Mar 29 '21 at 14:17