博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
修改MongoDb的 DB 和 Log 存储路径 (Windows)-摘自网络
阅读量:6435 次
发布时间:2019-06-23

本文共 1243 字,大约阅读时间需要 4 分钟。

Create a file called mongod.cfg in MongoDB folder if you dont have it. In my case: C:\Users\ivanbtrujillo\MongoDB

Then, edit mongod.cfg with notepad and add a line with the following (our custom dbpath):

dbpath=C:\Users\ivanbtrujillo\MongoDB\data\db

In this file you should especify the logpath too. My mongod.cfg file is:

logpath=C:\Users\ivanbtrujillo\MongoDB\log\mongo.logdbpath=C:\Users\ivanbtrujillo\MongoDB\data\db

If you uses mongoDB as a windows service, you have to change this key and especify the mongod.cfg file.

To install mongodb as a windows service run this command:

**"C:\Users\ivanbtrujillo\MongoDB\bin\mongod.exe" --config "C:\Users\ivanbtrujillo\MongoDB\mongod.cfg" –install**

Open regedit.exe and go to the following route:

HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\services\MongoDB

MongoDB service does not work, we have to edit the ImagePath key, delete its content and put the following:

**"C:\Users\ivanbtrujillo\MongoDB\bin\mongod.exe" --config "C:\Users\ivanbtrujillo\MongoDB\mongod.cfg" --logpath="C:\Users\ivanbtrujillo\MongoDB\log\mongo.log" –service**

We indicates to mongo it's config file and its logpath.

Then when you init the mongodb service, it works.

Here is a full tutorial to install mongoDB in windows:

转载地址:http://naqga.baihongyu.com/

你可能感兴趣的文章
Oracle Grid Infrastructure: Understanding Split-Brain Node Eviction (文档 ID 1546004.1)
查看>>
Linux改变进程优先级的nice命令
查看>>
**16.app后端如何保证通讯安全--url签名
查看>>
win32窗口机制之CreateWindow
查看>>
C/C++ 一段代码区分数组指针|指针数组|函数指针|函数指针数组
查看>>
awakeFromNib小总结
查看>>
java知识大全积累篇
查看>>
图像特效——摩尔纹 moir
查看>>
Android OpenGL ES(十)绘制三角形Triangle .
查看>>
EAGAIN、EWOULDBLOCK、EINTR与非阻塞 长连接
查看>>
善于总结所做所学的内容
查看>>
Lua-简洁、轻量、可扩展的脚本语言
查看>>
org.hibernate.MappingException: entity class not found hbm可以解析,但是实体类不能解析...
查看>>
Android -- Drag&&Drop
查看>>
Extjs4:改变Grid单元格背景色(转载)
查看>>
中医无绝症[转载]
查看>>
ZendStudio10.6.1如何安装最新的集成svn小工具?
查看>>
PHP中$_SERVER的详细参数与说明
查看>>
jquery easyui datagrid mvc server端分页排序筛选的实现
查看>>
去了大公司就一定能学到很牛的技术么?
查看>>