1

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.

njackson.gis
  • 73
  • 1
  • 6

2 Answers2

0

I'm not sure what your trying to start the service but a batch file would look like this:

@echo off 
set data="C:\mongo\data"
set log="C:\mongo\log"
@mkdir %log% 
@mkdir %data% 
set log=%log%\mongo.log"
bin\mongod.exe --dbpath %data% --logpath %log% --install 
net start mongodb
George P
  • 748
  • 5
  • 12
0

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.

Community
  • 1
  • 1
WiredPrairie
  • 54,618
  • 14
  • 105
  • 136
  • 2
    I have tried using the non-mapped method (\\SERVERNAME\SharedFolder\data\db) but I still cannot get the MongoDB Service to start. Would you suggest that create a service level account to run the service with? Currently, I am just using an admin account to start the service. Thanks. – njackson.gis Jan 22 '13 at 22:57
  • Yes, the account needs access to the share. Does the admin acct have full access? – WiredPrairie Jan 23 '13 at 00:53
  • 1
    I just checked and the admin account does have full access. I also tried to install the service with a different user but it did not work. – njackson.gis Jan 23 '13 at 19:23
  • 1
    You confirmed the user has full write access as well? (It's burned me more than once giving a user "share" access, but forgetting they still need access to read/write files within the share. – WiredPrairie Jan 23 '13 at 20:57
  • 1
    I finally got it. I just created a new share on the storage server, and then only allowed the Admin user full access to this shared space. Then I installed with the non-mapped method and it work. Thanks for your help with this WiredPrairie! – njackson.gis Jan 24 '13 at 11:25