Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Created June 15, 2018 06:05
Show Gist options
  • Save sarjarapu/880178066b989b1ed6fb912b75df952e to your computer and use it in GitHub Desktop.
Save sarjarapu/880178066b989b1ed6fb912b75df952e to your computer and use it in GitHub Desktop.
A JavaScript method invoking rs.freeze to make the replica set member ineligible to become primary
// Freeze mon03
rs.isMaster().me
// mon03:27000
rs.freeze(60)
/*
{
"ok" : 1,
"operationTime" : Timestamp(1529033711, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1529033711, 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