Search code examples
mongodbwindows-server-2012

MongoDB Window Service Connection to "data/db" on a File Server not Local Disk


I have install MongDB 2.2.2 on a Windows 8 Server and I cannot get the service to start. I am trying to connect to a db that is located on file server in the same network, but it will not start and I get this error:

"ERROR: dbpath (e:/data/db) does not exist.
 Create this directory or give existing directory in --dbpath."

e:/data/db is the mapped directory, and I have even tried connecting using \\SERVERNAME\SharedFolder\data\db and I still have the same results.


Solution

  • The MongoDB service (running as a particular user), must have the proper credentials to access the server and drive (and directory). It's very likely unless you've created a new user (and run the service as that user) that it does not have access to the path you've provided.

    Further, you can't as easily used a mapped drive as drive mapping takes place as an interactive user (which a service is not). While there are complex work-arounds, the better choice is to not use a mapped path and instead use the full (non-mapped) path such as \\servername\storage\db.