企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
从库读取报错,提示不是master ``` goumin:SECONDARY> show dbs; 2018-07-09T22:24:51.735-0400 E QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } at Error (<anonymous>) at Mongo.getDBs (src/mongo/shell/mongo.js:47:15) at shellHelper.show (src/mongo/shell/utils.js:630:33) at shellHelper (src/mongo/shell/utils.js:524:36) at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47 goumin:SECONDARY> goumin:SECONDARY> goumin:SECONDARY> rs.slaveOk() goumin:SECONDARY> show dbs; ActiveUser 0.000GB AppMessage 0.000GB BigData 0.000GB ClubData 0.002GB EventLog 0.000GB FansData 0.000GB Log 0.000GB MessageCenter 0.000GB RecommendData 0.001GB UserAction 0.000GB local 0.001GB mongodbPlatform 0.000GB mydatabase 0.000GB ``` 设置从库只读的配置文件 ``` cat .mongorc.js rs.slaveOk(); ```