mongodb after restoring replica-set from backup the primary is not master

by Maoz Zadok   Last Updated May 15, 2019 18:06 PM

after recovering replica-set from a snapshot (for testing) when I run commands on the primary I got error

not master and slaveOk=false

does primary not equal to master? I got this output for the command rs.isMaster() on the primary.

shard2-replset:PRIMARY> rs.isMaster()
{
    "hosts" : [
        "mongo-stage-rs-01-a.prod:27018",
        "mongo-stage-rs-01-b.prod:27018"
    ],
    "setName" : "shard2-replset",
    "setVersion" : 17,
    "ismaster" : false,
    "secondary" : true,
    "primary" : "mongo-stage-rs-01-b.prod:27018",
    "me" : "mongo-stage-rs-01-b.prod:27018",
    "electionId" : ObjectId("7fffffff0000000000000028"),
    "maxBsonObjectSize" : 16777216,
    "maxMessageSizeBytes" : 48000000,
    "maxWriteBatchSize" : 1000,
    "localTime" : ISODate("2019-05-15T17:09:13.275Z"),
    "maxWireVersion" : 4,
    "minWireVersion" : 0,
    "ok" : 1
}

is it make sence that the "primary" and "me" is the same, but yet "secondary" : true and "ismaster" : false,

    "ismaster" : false,
    "secondary" : true,
    "primary" : "mongo-stage-rs-01-b.prod:27018",
    "me" : "mongo-stage-rs-01-b.prod:27018",

mongodb version 3.2



Related Questions



Benchmarking Mongodb Queries Without cache

Updated June 20, 2017 09:06 AM

Recover MongoDB data without WiredTiger.wt file

Updated August 11, 2017 15:06 PM

MongoDB document delete and fragmentation

Updated August 05, 2015 14:02 PM