replSetGetConfig

New in version 3.0.0.

Definition

  • replSetGetConfig
  • Returns a document that describes the current configuration of thereplica set. To invoke the command directly, use thefollowing operation:
  1. db.runCommand( { replSetGetConfig: 1 } );

In the mongo shell, you can access the data provided byreplSetGetConfig using the rs.conf() method,as in the following:

  1. rs.conf();

Output Example

The following document provides a representation of a replica setconfiguration document. The configuration of your replica set mayinclude only a subset of these settings:

  1. {
  2. _id: <string>,
  3. version: <int>,
  4. protocolVersion: <number>,
  5. writeConcernMajorityJournalDefault: <boolean>,
  6. configsvr: <boolean>,
  7. members: [
  8. {
  9. _id: <int>,
  10. host: <string>,
  11. arbiterOnly: <boolean>,
  12. buildIndexes: <boolean>,
  13. hidden: <boolean>,
  14. priority: <number>,
  15. tags: <document>,
  16. slaveDelay: <int>,
  17. votes: <number>
  18. },
  19. ...
  20. ],
  21. settings: {
  22. chainingAllowed : <boolean>,
  23. heartbeatIntervalMillis : <int>,
  24. heartbeatTimeoutSecs: <int>,
  25. electionTimeoutMillis : <int>,
  26. catchUpTimeoutMillis : <int>,
  27. getLastErrorModes : <document>,
  28. getLastErrorDefaults : <document>,
  29. replicaSetId: <ObjectId>
  30. }
  31. }

For description of the configuration settings, seeReplica Set Configuration.

See also

rs.conf(), rs.reconfig()