将mongod作为Windows服务运行

将mongod作为Windows服务运行

本文介绍了将mongod作为Windows服务运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在win32上安装了mongodb,并且试图将其作为服务运行.

我已按照此处发布的说明进行操作: http ://www.deltasdevelopers.com/post/Running-MongoDB-as-a-Windows-Service.aspx

但是,当Windows尝试加载"/运行"服务时,就会出现问题.我看到服务控制标语下的服务始终处于启动"状态.

结果:服务未启动,Windows一直在尝试启动该服务,但未成功.

我遵循的指示是:

在命令行

C:\ mongodb \ mongod-安装然后C:\ mongodb \ mongod -service

然后我通过将ImagePath键设置为C:\ mongodb \ mongodb.exe -service的值来修改MongoDB服务的Win注册表项

有什么建议吗?我在做什么错了?

解决方案

仅供以后参考:将mongo作为Windows服务运行

很多人似乎在说:指定mongod.exe的整个路径:

c:\mongo\mongod.exe --logpath "c:\mongo\logs\mongo.log" --logappend --dbpath "c:\mongo\data" --directoryperdb --install

如果您正在运行Windows 7,请不要忘记以管理员身份运行命令窗口.

i have installed mongodb on win32 and i am trying to run it as a service.

I have followed the instructions posted here: http://www.deltasdevelopers.com/post/Running-MongoDB-as-a-Windows-Service.aspx

but when when windows tries to 'load'/'run' the service there is a problem. I see the service under the services control banner constantly in the 'starting' state.

The result: the service is not started and windows is constantly trying to start it without success.

The instructions i have followed are:

At the command line

C:\mongodb\mongod -installthenC:\mongodb\mongod -service

Then i modified the Win Registry Entry for the MongoDB Service by setting the ImagePath key to the value of C:\mongodb\mongodb.exe -service

Any advice? What am i doing wrong?

解决方案

Just for future reference: running mongo as a windows service

Also lots of people seem to be saying: specify the whole path to the mongod.exe:

c:\mongo\mongod.exe --logpath "c:\mongo\logs\mongo.log" --logappend --dbpath "c:\mongo\data" --directoryperdb --install

Also if you're running Windows 7 don't forget to run the command window as an administrator.

这篇关于将mongod作为Windows服务运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 05:52