0

Mongoose 5.10.10 - Windows 10+WSL2 - Mongo 4.4.1

Worked fine before the MongoDB upgrade. I dynamically acquire Windows IP in Ubuntu on WSL and connect (or try to) on WIN_IP:27017. Connection fails with timout every time. I've tried many combinations of options. Nothing helps. I've had to resort to Mongo in Docker, which works perfectly well, but is sub-optimal for my purposes.

Any ideas?

Thanks.

Jerry Rubin
  • 87
  • 1
  • 12

2 Answers2

0

Could have happened during Mongo upgrade or maybe during Windows upgrade. But several things needed fixing.

  1. Even though the Mongo bin directory has a mongod.cfg with dbPath specified correctly, mongod tries to start with dbPath = c:\data\db. This is how it would be set up on a server, I'm told.
  2. I changed mongod's bind ip address to 0.0.0.0 (from 127.0.0.1).
  3. I punched a hole in the firwall specifically for mongod.exe.

One or more of these changes did the trick. Sorry, I don't know if any one or two would have worked.

Jerry Rubin
  • 87
  • 1
  • 12
0

Had the same problem this week. I'm my case I just figured it out it was WSL version I updated over the weekend. Running wsl --set-version {distro} 1 on the PowerShell did the trick.