Recorded Webinar

Automated Geo Failover with Prepared Queries in HashiCorp Consul

Learn how Consul's prepared queries, a mature feature that's been a part of Consul's service discovery story for a long time, are able to simplify multi-datacenter management and add strong system resilience.


As more IT departments begin to harness cloud computing and build distributed systems for greater agility and scalability, operators are faced with more challenging situations. Maintaining system reliability becomes a lot harder. A modern network operations solution such as HashiCorp Consul can simplify the implementation of common reliability patterns, including service discovery, routing, service mesh, and more.

Consul also supports multiple datacenters out of the box. In a single datacenter, automatic failover for application services is relatively simple: Consul simply omits those instances from DNS lookups and tells administrators which services are down.

In a multi-datacenter scenario, there may be a complete outage of all instances of a service at one datacenter. Building a system that fails over to another datacenter's services can be time-consuming because that logic might have to be written into each application.

Consul avoids that task by providing a prepared query API. The prepared query API. With a prepared query, you can write and register a complex service query in advance of when it will be needed. With a prepared query, you can write and register a complex service query in advance of when it will be needed. This allows administrators to define centralized failover policies for multiple datacenters before incidents occur.

In this webinar, HashiCorp solutions engineer Vinnie Ramirez will demonstrate a geo failover scenario for a microservice using Consul's prepared queries, showcasing Consul's capabilities around service discovery and cluster federation.


0:00 — Introduction to the Consul multi-datacenter architecture

7:25 — Consul Kubernetes support features

10:16 — Hybrid cloud, multi-cloud, multi-scheduler Consul

13:10 — Demo: Consul Geo Failover with Prepared Queries

35:23 — Reviewing the Consul service mesh maturity model

39:08 — Q&A


  • Are there differences between open source Consul federation and Consul Enterprise federation?

  • How much of this talk is applicable to the OSS version of Consul versus the enterprise version? (Everything discussed is available in the open source version)

  • How do you federate between 2 Consul clusters? What are the steps? (HashiCorp Learn Tutorial: Multiple Datacenters: Basic Federation with WAN Gossip

  • Are prepared queries available out-of-box in Consul? (Yes)

  • What is the simplest way to get started with Prepared Queries?

  • Is Consul Connect open source?(Yes)

  • How does Consul Connect integrate with prepared queries for failover requests? Service resolver documentation

  • Is service resolver available in Consul 1.6?

  • Does Envoy proxy consume prepared queries in Connect?

  • How does Consul compare to F5 iRules / InfoBlox? Learn more about Consul and F5 integration in this Sept 4 webinar

  • How do I visualize my ingress traffic with a service mesh?

More resources like this one

  • 3/15/2023
  • Case Study

Using Consul Dataplane on Kubernetes to implement service mesh at an Adfinis client

  • 1/20/2023
  • FAQ

Introduction to Zero Trust Security

  • 1/4/2023
  • Presentation

A New Architecture for Simplified Service Mesh Deployments in Consul

  • 12/31/2022
  • Presentation

Canary Deployments with Consul Service Mesh on K8s