[英]oplog enable on standalone mongod not for replicaset
I am running mongod as standalone server .now i want to enable oplog for it ,i want to know whether it is possible or not ? 我正在运行mongod作为独立服务器。现在我想为它启用oplog,我想知道它是否可能?
I knew I can do this by creating single node ReplicaSet ,but I want to do this without replica set . 我知道我可以通过创建单个节点ReplicaSet来实现这一点,但我想在没有副本集的情况下这样做。
I got a reply from the MongoDb Team, and it's working fine. 我收到了MongoDb团队的回复,而且工作正常。
To enable oplog
on a standalone server, start mongo
with master
options. 要在独立服务器上启用
oplog
,请使用master
选项启动mongo
。
On command line start mongod --master
. 在命令行启动
mongod --master
。
For conf file append the following line: 对于conf文件,请添加以下行:
master=true
For mongo 2.6 or greater the /etc/mongod.conf now uses a yaml format. 对于mongo 2.6或更高版本,/ etc / mongod.conf现在使用yaml格式。
To enable the oplog add something similar to the below, note the replication:
line may already exist, be sure to use spaces. 要启用oplog添加类似于下面的内容,请注意
replication:
行可能已存在,请务必使用空格。
replication:
replSetName: rs0
oplogSizeMB: 100
Full documentation here: https://docs.mongodb.com/manual/reference/configuration-options/#replication-options 完整文档: https : //docs.mongodb.com/manual/reference/configuration-options/#replication-options
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.