crapthings / meteor-issues

2 stars 0 forks source link

mongodb 启用 oplog #6

Open crapthings opened 8 years ago

crapthings commented 8 years ago

mongodb 3.2.x

如果通过 mongo 官方 apt 安装的话编辑config

nano /etc/mongod.conf

找到

#replication

改成

replication:
    replSetName: rs0

重启服务

service mongod restart

连入 mongo shell

mongo

输入

rs.initiate()

看到如下代表成功,也可以通过 rs.status() 查看

{
  "info2": "no configuration specified. Using a default configuration for the set",
  "me": "192.168.1.89:27017",
  "ok": 1
}
crapthings commented 8 years ago

本地可以测试一个打开 oplog 的 mongo,如果看到数据是实时的说明成功了。

export MONGO_URL=mongodb://192.168.1.89:27017/meteor-issues
export MONGO_OPLOG_URL=mongodb://192.168.1.89:27017/local

meteor
crapthings commented 7 years ago

https://stackoverflow.com/questions/42925101/mongoerror-not-authorized-on-local-to-execute-command-while-deploy-on-meteor-ga