Lesson 2: Cluster Status and Health / Learn

Press O for more options
4:11

Video Transcript (English)

MongoDB Atlas provides tools that allow us to monitor the health and status of database deployments.

In this video, you will learn how to use the Atlas UI and CLI to monitor the health of your Atlas cluster and check the status of cluster nodes.

Let’s begin by exploring some of the tools in the Atlas UI.

We’re already logged into our Atlas account and have selected the Organization and Project that we want to view. Our Database Deployments page displays some basic information, such as version, region, cluster tier, and type.

Atlas gives us several ways to view information about our cluster. In Atlas, we can access the Overview page by clicking here. This gives a high-level view of the cluster status.

Each node in our cluster is listed with a label that indicates whether it’s the primary or secondary node. Next to each node is a green circle indicating that the node is up and running.

We can view more details about our cluster nodes by navigating to Metrics. This view is also available by clicking the View Monitoring button in your cluster view.

On this screen, we see all three cluster nodes. We can view metrics for each node and adjust our view by toggling the charts. Here, we’re viewing Connections and Opcounters.

Let’s select the primary node. Now we’re viewing the same metrics, but only for this particular node.

If we want to know more about cluster status and activity, we can view the Project Activity feed.

The events in this feed provide details about user events and the state of our cluster.

We can filter by event type, cluster, and time range. We can also combine filtering methods to have greater control over the activity feed output.

Let’s say that we want to check if there’s been any activity in the cluster. To do this, we select Clusters from Filter by Event. We get a list of cluster events that took place.

Here, we see that the replica set elected a new primary.

We can also view information about our cluster by using Atlas CLI commands.

Let’s run `atlas processes list` to retrieve some information about the cluster. The output gives us basic information about our cluster nodes, including the ID, replica set name, and version.

Now that we have process IDs, we’ll run the `atlas metrics processes` command to get metrics for one of the nodes.

Here, we have the process ID from the previous command.

Now we specify the period, or granularity, to limit our output. We’ve specified a period of 1 day.

Next, we set the output to JSON format.

Finally, we use the `type` flag to specify that we want only metrics about connections.

When we run the `atlas metrics processes` command, we get this output.

The measurements array that’s returned gives us metrics and their data points. The dataPoints array shows that there were 0 connections measured during the period that we selected. It also gives a timestamp for the measurement.

We used this command to get metrics about cluster connections, but it can be used to check other metrics that we saw in the Metrics tab in the Atlas UI. These include opcounters, network, and logical size.

Let’s recap what you learned in this video: The Atlas UI and CLI provide a number of tools to check the health and status of database deployments. With the Atlas UI, we can monitor the status of cluster nodes by using the Database Deployments page. We can also use the Project Activity Feed to check cluster events, such as elections.

The Atlas CLI provides commands to view details about our cluster. atlas processes list provides the process id, version, and replica set name for each node. atlas metrics processes allows us to view metrics for a particular node over a specific time period.