我对副本集有疑问
将 keyFile 路径添加到 mongodb.conf 后,我可以连接,这是我的 mongo.conf:
logpath=/path/to/log
logappend=true
replSet = rsname
fork = true
keyFile = /path/to/key
这就是命令行中显示的内容:
XXXX@XXXX:/etc$ sudo service mongodb restart
stop: Unknown instance:
mongodb start/running, process 10540
XXXX@XXXX:/etc$ mongo
MongoDB shell version: 2.4.6
connecting to: test
Mon Sep 30 18:44:20.984 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
XXXX@XXXX:/etc$
如果我在 mongo.conf 中注释 keyFile 行,它可以正常工作。