class OkComputer::MongoidReplicaSetCheck

This class provides a check for a mongodb replica set via the Mongoid ORM.

The check first refreshes the cluster status, which communicates with all the nodes, discovers any new ones, and figures out which node is the primary and which ones are the secondaries. Nodes that are recovering or unavailable are automatically removed from rotation. It’s okay to do this fairly frequently.

The second part of the check attempts to contact the primary node (to ensure writes are accepted) and a secondary node (to ensure reads can be distributed).

This calls the replSetGetStatus command on the admin database of each node. This provides further information as well as the replica set’s name. This could potentially be parsed for more actionable information.