Service Discovery Made Easy

Service registry, integrated health checks, and DNS and HTTP interfaces enable any service to discover and be discovered by other services

Service discovery for connectivity to remove manual processes

The Challenge

Service load balancers aren't efficient in a dynamic world.

Before

  • Reduced productivity from frequent manual updates to load balancers as services scale up/down

  • Increased cost with a proliferation of east-west load balancers

  • Increased risk with higher probability of human errors and single points of failure introduced by load balancers.

The Solution

Service discovery for dynamic infrastructure.

After

  • Improve productivity by reducing lead time of connecting services from weeks to seconds without operator intervention.

  • Reduce cost by eliminating the need for east-west load balancers to connect services

  • Reduce risk by lowering the probability of downtime introduced when managing and updating load balancers

Delivering network as a service in a heterogeneous environment

Bloomberg builds a service discovery platform to connect more than 20000 nodes across a complex and diverse environment. The platform allows thousands of developers to register and connect their applications with each other in a self-service manner.

Read Case Study

Service Discovery 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.

Consul nodes UI

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.

  1. $ dig web-frontend.service.consul. ANY
  2. ; <<>> DiG 9.8.3-P1 <<>> web-frontend.service.consul. ANY
  3. ;; global options: +cmd
  4. ;; Got answer:
  5. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29981
  6. ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
  7. ;; QUESTION SECTION:
  8. ;web-frontend.service.consul. IN ANY
  9. ;; ANSWER SECTION:
  10. web-frontend.service.consul. 0 IN A 10.0.3.83
  11. 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.

  1. $ curl http://localhost:8500/v1/kv/deployment
  2. [
  3. {
  4. "LockIndex": 1,
  5. "Session": "1c3f5836-4df4-0e26-6697-90dcce78acd9",
  6. "Value": "Zm9v",
  7. "Flags": 0,
  8. "Key": "deployment",
  9. "CreateIndex": 13,
  10. "ModifyIndex": 19
  11. }
  12. ]

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.

  1. $ curl http://localhost:8500/v1/catalog/datacenters
  2. [
  3. "dc1",
  4. "dc2"
  5. ]
  6. $ curl http://localhost:8500/v1/catalog/nodes?dc=dc2
  7. [
  8. {
  9. "ID": "7081dcdf-fdc0-0432-f2e8-a357d36084e1",
  10. "Node": "10-0-1-109",
  11. "Address": "10.0.1.109",
  12. "Datacenter": "dc2",
  13. "TaggedAddresses": {
  14. "lan": "10.0.1.109",
  15. "wan": "10.0.1.109"
  16. },
  17. "CreateIndex": 112,
  18. "ModifyIndex": 125
  19. },
  20. ...

Health Checks

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

Consul nodes UI

Open Source and Enterprise Features

Learn more about service discovery, service segmentation and service configuration features with Consul Open Source and operations, governance, and multi-datacenter features with Consul Enterprise

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×