You can use the Ops Manager API to determine whether a replica set member fell too far behind to catch up. You can also read the member's last replication error.
Ops Manager adds two fields to the host document, tooStale and lastReplError, and returns them from new v2.0 versions of the three Get Host endpoints. The v1.0 endpoints are unchanged and never return the new fields.
To call these endpoints, you must have the Project Read Only role.
What's New
Item | Detail |
|---|---|
New endpoints | v2.0 versions of Get One Host by ID, Get One Host by Hostname and Port, and Get All Hosts. Same paths as v1.0 under |
New fields |
|
Existing endpoints | v1.0 is unchanged, including the hosts endpoints in the Admin API. |
Before You Begin
Your deployment must run Ops Manager 8.0.28 or 9.0.2 or later.
Monitoring must be enabled for the project. If monitoring is disabled, Ops Manager omits the new fields.
Change the base path of your requests from
/api/public/v1.0to/api/public/v2.0. The rest of each request is unchanged.
Check a Member's Replication Health
Find the host.
Use v2.0 Get All Hosts to list hosts, or use the hostname:port you already know.
New Fields
Name | Type | Description |
|---|---|---|
tooStale | boolean | The member fell behind the oplog window and could not catch up from the replica set. The member requires an initial sync. |
lastReplError | string | The member's last replication error, from |
Field Behavior
The following table describes how Ops Manager populates the new fields in specific scenarios.
Scenario | Behavior |
|---|---|
Host is a healthy replica set member |
|
Member is behind the oplog window |
|
Host isn't a replica set member | Both fields are omitted. |
Request uses a v1.0 endpoint | Both fields are omitted. |
Get All Hosts | Each host reports its own member's values, not the replica set's. |
Both fields describe the single host in the response, not the whole replica set.
Troubleshooting
The following table describes common errors and symptoms when you use the v2.0 Get Host endpoints.
Symptom | Likely Cause | Resolution |
|---|---|---|
| The base path is | Use |
| The host isn't a replica set member, monitoring is disabled, or you called a v1.0 endpoint. | Confirm the host belongs to a replica set, monitoring is enabled, and the path uses v2.0. |
| The member reports no replication error. | No action needed. |
|
| Confirm the value with v2.0 Get All Hosts. |
Use the API
To read replication health programmatically, see Get Hosts with Replication Health.