Failed Global Initialization: BadValue logpath requires an absolute file path with windows services

前端 未结 10 1512
庸人自扰
庸人自扰 2021-02-19 07:25

I am getting this error constantly while i am trying to install mongod using a configuration file. So, I am looking at this tutorial on Pluralsight on mongodb. The person\'s pro

相关标签:
10条回答
  • 2021-02-19 08:17

    echo logpath=C:/myProgra/MongoDB/log/mongo.log > "C:\MyProgram\MongoDB\mongod.cfg" C:\myprogram\MongoDB\Server\3.0\bin\mongod.exe --config "C:\myProgram\MongoDB\mongod.cfg" --install

    0 讨论(0)
  • 2021-02-19 08:21

    Thanks for the suggestions guys. I just went with MongoDB's instructions on their website on installing mongod as a service in windows instead of Pluralsight tutorial's and it went well.

    0 讨论(0)
  • 2021-02-19 08:24

    I got the same error

       **Failed Global Initialization: BadValue logpath requires an absolute file path with windows services**
    

    as I was specifying log path folder in mongo.config but I have to specify a log file

      dbpath=C:\Program Files\MongoDB\Server\3.4\data\db
      logpath=C:\Program Files\MongoDB\Server\3.4\log
      diaglog=3
    

    i changed my log file to

     dbpath=C:\Program Files\MongoDB\Server\3.4\data\db
     logpath=C:\Program Files\MongoDB\Server\3.4\log\mongo.log
     diaglog=3
    

    and after that this command solved my problem. hope this workfor you as well.

     mongod.exe --config "C:\Program Files\MongoDB\Server\3.4\mongo.config" --install
    

    then finally

    net start MongoDB
    
    0 讨论(0)
  • 2021-02-19 08:28

    I ran into the same problem. But I could resolve it by updating the paths as follows. I could see the problem is with Forward and backward slashes in file paths.

    mongod.conf (instead of giving the relative path provide absolute path and also make sure you have "/" instead of "\")

    dbpath= C:/mongolearning/db
    logpath= C:/mongolearning/mongo-server.log
    verbose=vvvvv
    

    and then go to Command prompt:

    C:\Program Files\MongoDB\Server\3.2\bin>mongod -f "C:\Program Files\MongoDB\Server\3.2\bin\mogod.conf" --install
    

    and then

    C:\Program Files\MongoDB\Server\3.2\bin>net start mongodb
    

    Boom it started.

    The MongoDB service is starting. The MongoDB service was started successfully.

    0 讨论(0)
提交回复
热议问题