Open crapthings opened 8 years ago
如果通过 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 }
本地可以测试一个打开 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
https://stackoverflow.com/questions/42925101/mongoerror-not-authorized-on-local-to-execute-command-while-deploy-on-meteor-ga
mongodb 3.2.x
如果通过 mongo 官方 apt 安装的话编辑config
找到
改成
重启服务
连入 mongo shell
输入
看到如下代表成功,也可以通过 rs.status() 查看