简体   繁体   English

MongoDB启用oplog不起作用

[英]Mongodb enable oplog not working

I have a standalone instance of mongodb (on windows) and want to enable oplog without replicaset. 我有一个mongodb的独立实例(在Windows上),想要启用oplog而不使用copysetset。

I found this SO post and set the --master option in my windows service path. 我找到了这个帖子,并在Windows服务路径中设置了--master选项。 But oplog is not created. 但是没有创建oplog。 Any advice? 有什么建议吗?

D:\\MongoDB\\2.6.5\\bin\\mongod.exe --dbpath=D:\\MongoDB\\2.6.5\\data\\db\\ --logpath=D:\\MongoDB\\2.6.5\\log\\mongo.log --service --master D:\\ MongoDB \\ 2.6.5 \\ bin \\ mongod.exe --dbpath = D:\\ MongoDB \\ 2.6.5 \\ data \\ db \\ --logpath = D:\\ MongoDB \\ 2.6.5 \\ log \\ mongo.log-服务--master

oplog enable on standalone mongod not for replicaset oplog在独立mongod上启用,而不用于副本集

Besides starting it with --master and --logpath you also need to enable it manually by executing the following in mongo shell: 除了使用--master和--logpath启动它之外,您还需要通过在mongo shell中执行以下命令来手动启用它:

use local

rs.initiate( { _id : 'q', version : 1, members : [ {_id : 0, host : '127.0.0.1'} ] } )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM