We've now seen how simple it is to run Consul, add nodes and services, and query those nodes and services. In this section, we will continue our tour by adding health checks to both nodes and services. Health checks are a critical component of service discovery that prevents using services that are unhealthy.
We've now seen how simple it is to run Consul, add nodes and services, and query those nodes and services. In this step, we will continue our tour by adding health checks to both nodes and services. Health checks are a critical component of service discovery that prevent using services that are unhealthy.
---
# Health Checks
@ -11,29 +11,32 @@ description: |-
We've now seen how simple it is to run Consul, add nodes and services, and
query those nodes and services. In this section, we will continue our tour
by adding health checks to both nodes and services. Health checks are a
critical component of service discovery that prevents using services that
critical component of service discovery that prevent using services that
are unhealthy.
This page will build upon the previous page and assumes you have a
two node cluster running.
This step builds upon [the Consul cluster created previously](join.html).
At this point, you should have a two-node cluster running.
## Defining Checks
Similar to a service, a check can be registered either by providing a
[check definition](/docs/agent/checks.html) or by making the
appropriate calls to the [HTTP API](/docs/agent/http.html).
appropriate calls to the [HTTP API](/docs/agent/http/health.html).
We will use the check definition because, just like with services, definitions
are the most common way to set up checks.
We will use the check definition approach because, just like with
services, definitions are the most common way to set up checks.
Create two definition files in the Consul configuration directory of