For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Replica Set Re-Election Jobs API

You can use the Ops Manager API to perform replica set re-elections without connecting directly to the deployment's hosts. Use this resource to make the current primary step down, make a specific secondary step up to become primary, and track the resulting jobs.

Each request queues a job that the target host's Automation Agent executes on its next check-in. Use the following endpoints to create and retrieve re-election jobs.

Before you use the Re-Election Jobs resource, review the following requirements.

Note

Groups and projects are synonymous terms. Your {PROJECT-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. This page uses the more familiar term group when referring to descriptions. The endpoint remains as stated in the document.

Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0

To use the Re-Election Jobs resources, you must be an Ops Manager user with the Project Automation Admin role.

Important

This feature requires a paid Ops Manager subscription on an unmanaged (self-hosted) deployment.

Your deployment must run Ops Manager 8.0.27 or 9.0.0 or later, and the target host's Automation Agent must run version 109.0.0.9226-1 or later and must have pinged Ops Manager recently.

Only one re-election job, either a step-down or a step-up request, can be outstanding per replica set at a time. If a job is already queued or running, Ops Manager rejects a new request against the same replica set with a 409 REELECTION_ALREADY_IN_PROGRESS error.

Important

Replica set re-election is not supported for Kubernetes Operator (MCK) deployments.

The following table lists the endpoints available for the Re-Election Jobs resource.

Method
Endpoint
Description

POST

Requests that the current primary of a replica set step down.

POST

Requests that a specific secondary step up to become primary.

GET

Retrieves a single re-election job as specified by the reElectionJobId.

GET

Retrieves all re-election jobs for the specified replica set.

Rate this page