我想知道如何解决通过https://docs.aws.amazon.com/quickstart/latest/mongodb/step2.html
安装的MongoDB中的“ NotMasterNoSlaveOk”错误。但是,在主节点上,查询工作正常。谢谢
s0:SECONDARY> show databases
2019-06-05T15:23:38.144+0000 E QUERY [js] Error: listDatabases failed:{
"operationTime" : Timestamp(1559748208, 1),
"ok" : 0,
"errmsg" : "not master and slaveOk=false",
"code" : 13435,
"codeName" : "NotMasterNoSlaveOk",
"$clusterTime" : {
"clusterTime" : Timestamp(1559748208, 1),
"signature" : {
"hash" : BinData(0,"gNX/KuNT6jOwDeXih0fC28Wn5Pc="),
"keyId" : NumberLong("6696280813954138113")
}
}
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:67:1
shellHelper.show@src/mongo/shell/utils.js:876:19
shellHelper@src/mongo/shell/utils.js:766:15
@(shellhelp2):1:1
s0:SECONDARY> exit
bye
版本
MongoDB shell version v4.0.1
MongoDB server version: 4.0.10