[DOCS-1549] replSetMaintenance Created: 28/May/13  Updated: 30/Oct/23  Resolved: 29/May/13

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: mongodb-2.4
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Critical - P2
Reporter: Michael Marx Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Production


Participants:
Days since reply: 10 years, 38 weeks, 1 day ago

 Description   

I am trying to take a server out of maintenance mode using replSetMaintenance, however, I can't figure out how to run this command. The documentation lists the command, but not how to run. I was under the impression that the following would work:

db.runCommand(

{ replSetMaintenance : 1 }

)

However, this does not work. Please advise.



 Comments   
Comment by Scott Hernandez (Inactive) [ 29/May/13 ]

It is best to ask these kinds of question on our mongodb-user list: http://groups.google.com/group/mongodb-user
Do you see the the error message saying you need to run this against the "admin" database?

>db.runCommand("replSetMaintenance")
{ "ok" : 0, "errmsg" : "access denied; use admin db" }

You must do something like this to run it against the admin db:

db.adminCommand({replSetMaintenance:true})
db.adminCommand({replSetMaintenance:false})//disable when done

Generated at Thu Feb 08 07:41:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.