Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sarjarapu/ead77d0c2270ecd867b6e2f6617b0d29 to your computer and use it in GitHub Desktop.
Save sarjarapu/ead77d0c2270ecd867b6e2f6617b0d29 to your computer and use it in GitHub Desktop.
A JavaScript code to reset the electionTimeoutMillis back to its default value
rs.isMaster().me
// mon02:27000
// rs0:PRIMARY>
// on the new primary
var conf = rs.conf()
conf.settings.electionTimeoutMillis=10000
/*
rs.reconfig(conf)
{
"ok": 1,
"operationTime": Timestamp(1529034252, 1),
"$clusterTime": {
"clusterTime": Timestamp(1529034252, 1),
"signature": {
"hash": BinData(0, "AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId": NumberLong(0)
}
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment