FLX_BACKEND_MONGODB_004 Alert

Description

A critical Alert is raised when the MongoDB SECONDARY lags in replications from the PRIMARY node.

Severity

This alert is flagged as Critical.

Customer Impact

This alert is triggered when there is MongoDB SECONDARY lags in replications from the PRIMARY node for more than 5 minutes. Slow Replication can break the mongodb Cluster.

Operational Remediation Process

Login to any one of the services nodes which are hosting the mongodb.

MongoDB runs on three node clusters where it has one PRIMARY (leader) and two SECONDARY(slave).

Command to login to mongodb console.

$ docker compose exec mongo mongo --username \
      root --password <mongodb_root_password> \
      --authenticationDatabase admin

once logged in to the mongodb console, first, check the cluster status by running the below command

mongodb> rs.status()

This command should show the PRIMARY and SECONDARY node information. It should also show the duration of how long a node has been assigned with the role of PRIMARY. The output would also show the lag time. You need to check for replset_member_optime_date in the output and compare it with the optime of PRIMARY.

Make sure you have a healthy mongodb cluster of one PRIMARY and two SECONDARY nodes.

The other cause of replication delay can be heavy resource usage on the service node. Please check if the services nodes have enough resources to run the mongodb services. Also, check if there is any network latency among the servers.