import CallToAction from '@hashicorp/react-call-to-action' import CaseStudySlider from '@hashicorp/react-case-study-slider' import CodeBlock from '@hashicorp/react-code-block' import BeforeAfterDiagram from '../../components/before-after' export default function ServiceDiscovery() { return ( <>

Features

Service Registry

Consul provides a registry of all the running nodes and services, along with their current health status. This allows operators to understand the environment, and applications and automation tools to interact with dynamic infrastructure using an HTTP API.

Learn more

Service Registry

DNS Query Interface

Consul enables service discovery using a built-in DNS server. This allows existing applications to easily integrate, as almost all applications support using DNS to resolve IP addresses. Using DNS instead of a static IP address allows services to scale up/down and route around failures easily.

Learn more

> DiG 9.8.3-P1 <<>> web-frontend.service.consul. ANY ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29981 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;web-frontend.service.consul. IN ANY ;; ANSWER SECTION: web-frontend.service.consul. 0 IN A 10.0.3.83 web-frontend.service.consul. 0 IN A 10.0.1.109 `} />

HTTP API with Edge Triggers

Consul provides an HTTP API to query the service registry for nodes, services, and health check information. The API also supports blocking queries, or long-polling for any changes. This allows automation tools to react to services being registered or health status changes to change configurations or traffic routing in real time.

Learn more

"critical", "ServiceID": "web", "ServiceName": "web", "CreateIndex": 10, "ModifyIndex": 20 ... } `} />

Multi Datacenter

Consul supports multiple datacenters out of the box with no complicated configuration. Look up services in other datacenters or keep the request local. Advanced features like Prepared Queries enable automatic failover to other datacenters.

Learn more

dc2", "TaggedAddresses": { "lan": "10.0.1.109", "wan": "10.0.1.109" }, "CreateIndex": 112, "ModifyIndex": 125 }, ... `} />

Health Checks

Pairing service discovery with health checking prevents routing requests to unhealthy hosts and enables services to easily provide circuit breakers.

Learn more

Health Checks

Use Cases

Ready to get started?

Download Explore docs
) }