无法在 Windows 上作为服务启动 Mongodb 2.6.3 [英] Can not start Mongodb 2.6.3 on Windows as service

查看:34
本文介绍了无法在 Windows 上作为服务启动 Mongodb 2.6.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在 widnows 7 x64 上安装和启动 mongodb 服务

Trying to install and start mongodb service on widnows 7 x64

mongod.cfg:

mongod.cfg:

systemLog:
   destination: file
   path: "c:\\mongo\\logs\\mongo.log"
   quiet: true
   logAppend: true

storage:
   dbPath: "C:\\mongo\\data"
   directoryPerDB: true

这工作正常(mongodb 启动,写入日志/mongo.log):

This works fine (mongodb starts, wrhites to logs/mongo.log):

bin\mongod.exe --config mongod.cfg 

我安装服务:bin\mongod.exe --config mongod.cfg --install

I install service: bin\mongod.exe --config mongod.cfg --install

但是在服务开始时,我收到了警报:

But on service start I've got an alert:

Windows 无法在本地计算机上启动 MongoDB 服务.

Windows could not start the MongoDB service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.

日志文件中没有任何内容

nothing in log file

尝试以普通格式进行配置:

tried config in plain format:

logpath=c:\mongo\logs\mongo.log
logappend=true 
dbpath=C:\mongo\data
directoryperdb=true

同样的结果

推荐答案

安装windows服务时必须使用配置文件的完整路径,例如:

You must use the full path of the configuration file when you install the windows service, for example:

bin\mongod.exe --config c:\mongo\mongod.cfg --install

这篇关于无法在 Windows 上作为服务启动 Mongodb 2.6.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆