简体   繁体   English

oplog启用独立mongod而不是replicaset

[英]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

More details here . 更多细节在这里

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.

相关问题 套接字+节点+ mongodb + oplog:连接到副本集 - socket + node + mongodb + oplog: connect to a replicaset 在 MongoDB Bitnami 副本集架构中配置 Oplog 大小 - Configure Oplog Size in MongoDB Bitnami Replicaset Architecture mongorestore从独立到复制 - mongorestore from standalone to replicaset MongoDB 启用 oplog 窗口 - MongoDB enable oplog windows MongoDB启用oplog不起作用 - Mongodb enable oplog not working Spring Data Mongodb - 独立mongo和replicaset的单一配置 - Spring Data Mongodb - single configuration for standalone mongo and replicaset 将mongodb独立节点转换为副本集需要花费多长时间? - how long will it cost when I convert a mongodb standalone node to replicaset? 如何使用 Mongoose 6.0.8 连接到运行在 Docker 中的 Mongo Standalone ReplicaSet? - How to connect to a Mongo Standalone ReplicaSet, running in Docker, with Mongoose 6.0.8? 启动mongodb单服务器作为副本集通过supervisord启用oplog - starting mongodb single server as replica set to enable oplog through supervisord 为什么当我在安装后启动 mongod 时它卡在 [ftdc] 将集合 local.oplog.rs 标记为集合版本:<unsharded> - Why when i start mongod after installation it got stuck to [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM