Pawan
Pawan

Reputation: 32331

MongoDB : Understanding MongoDB Internal Details .

We are using Mongo DB for our Application .

Currently when i issue the db.isMaster() command in our Mongo Shell .

It displayed this below information ( This set up is currently associated with our development box )

PRIMARY> db.isMaster()
{
        "setName" : "dev",
        "ismaster" : true,
        "secondary" : false,
        "hosts" : [
                "10.11.13.111:27017",
                "10.11.13.111:27018"
        ],
        "arbiters" : [
                "10.11.13.111:27019"
        ],
        "primary" : "10.11.13.111:27017",
        "me" : "10.11.13.111:27017",
        "maxBsonObjectSize" : 16777216,
        "ok" : 1
}

Please let me know what does the above information means ??

1 . Does it mean that it has got 1 primary and two secondary slaves ?? (One arbitrary also present in list )

  1. How can i know if slaveOk is set to true or false ??

Thnaks in advance .

Upvotes: 1

Views: 301

Answers (1)

madhead
madhead

Reputation: 33491

  • setName is the name of your replica set.
  • ismaster obviously indicates whether the node you are connected to master or slave.
  • secondary is contrary to ismaster.
  • hosts are host:port pairs of nodes storing data in replica set.
  • arbiters are host:port pairs of arbiters. These nodes can not store data, but their votes are used in master election process.
  • primary indicates who is primary.
  • me - indicates the node you are connected to.
  • maxBsonObjectSize - 16MB for now. Just a very global constant.
  • ok - kinda of a return code.

All can be found here. And regarding your questions:

  1. No, you have two nodes. One primary (10.11.13.111:27017) and one slave (10.11.13.111:27018)
  2. Check this. It is cursor operation.

Upvotes: 2

Related Questions