6

I would like to know how to fix the "NotMasterNoSlaveOk" error in a MongoDB that was installed via: https://docs.aws.amazon.com/quickstart/latest/mongodb/step2.html

However, on the primary node, queries work fine. Thank you

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

Version

MongoDB shell version v4.0.1
MongoDB server version: 4.0.10

ipegasus
  • 14,796
  • 9
  • 52
  • 76

0 Answers0