SlideShare a Scribd company logo
Introduction to
service discovery
and
self-organizing cluster orchestration
#pivorak 2016
Andrey Kryachkov & Roman V. Babenko
romanvbabenko@linkedin
romanvbabenko@github
romanvbabenko@twitter
andreykryachkov@linkedin
kryachkov@github
kryachkov@twitter
Old School web app infrastructure
Nodes
Hardcoded addresses
Rebuild nodes on env change
No need for service discovery
Modern web app infrastructure
Roles, not nodes
No hardcoded addresses
Easy failure recovery
Seamless scaling up and down
HashiCorp Serf and Consul
Serf
Serf is a decentralized solution for cluster membership, failure detection, and
orchestration. Lightweight and highly available.
https://www.serfdom.io/
Serf
MEMBERSHIP
FAILURE DETECTION
EVENTS AND QUERIES
Serf
MEMBERSHIP
FAILURE DETECTION
EVENTS AND QUERIES
Serf
MEMBERSHIP
FAILURE DETECTION
EVENTS AND QUERIES
Serf
MEMBERSHIP
FAILURE DETECTION
EVENTS AND QUERIES
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
Serf :: USE CASES
Web Servers and Load Balancers
Clustering Memcached or Redis
Triggering Deploys
Updating DNS Records
Simple Observability
A Building Block for Service Discovery
demo : production
app
serf
db
serf
server {
# ...
location / {
if (-f $document_root/maintenance.txt)
{
return 503;
}
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
}
demo : maintenance on
app
serf
db
serf
# serf/member-failed.sh
#!/bin/bash
while read line; do
ROLE=`echo $line | awk '{print $3 }'`
if [ "${ROLE}" == "db" ]; then
touch /usr/share/nginx/html/maintenance.txt
fi
done
demo : maintenance off
app
serf
db
serf
# serf/member-join.sh
#!/bin/bash
while read line; do
ROLE=`echo $line | awk '{print $3 }'`
if [ "${ROLE}" == "db" ]; then
rm /usr/share/nginx/html/maintenance.txt
fi
done
Serf in action video
Consul
Service discovery and configuration made easy. Distributed, highly available, and
datacenter-aware
https://www.consul.io
Consul
Service Discovery
Health Checking
Multi Datacenter
Data Storage
Consul
Service Discovery
Health Checking
Multi Datacenter
Data Storage
Consul
Service Discovery
Health Checking
Multi Datacenter
Data Storage
Consul
Service Discovery
Health Checking
Multi Datacenter
Data Storage
Consul
Service Discovery
Health Checking
Multi Datacenter
Data Storage
Consul architecture
Serf vs Consul
Serf Consul
● Decentralized
● Simple health checks
● Node-level membership
● Degraded performance over WAN
● More general purpose-tool
● Will operate until the last node is
alive
● Requires Consul servers (1/3/5)
● Rich health checks
● Service-level membership
● Key/value storage
● Built-in multi-DC support
● Can’t operate w/o central servers
quorum
Conclusions
TREAT CONFIGURATION AS A CODE
SERVICE DISCOVERY EASES SCALING AND RECOVERY
SOME NICE TOOLS FOR SERVICE DISCOVERY EXIST
BTW: More from HashiCorp
Vagrant Packer Terraform Vault Nomad Otto
Questions?

More Related Content

PDF
Service discovery in a microservice architecture using consul
Jos Dirksen
 
PDF
Consul in 5 minutes
Christophe Marchal
 
PDF
Consul First Steps
Marc Cluet
 
PDF
Infrastructure development using Consul
Grid Dynamics
 
PDF
Consul: Microservice Enabling Microservices and Reactive Programming
Rick Hightower
 
PDF
Consul: Service-oriented at Scale
C4Media
 
PDF
Consul
Ariel Moskovich
 
PPTX
Docker Service Registration and Discovery
m_richardson
 
Service discovery in a microservice architecture using consul
Jos Dirksen
 
Consul in 5 minutes
Christophe Marchal
 
Consul First Steps
Marc Cluet
 
Infrastructure development using Consul
Grid Dynamics
 
Consul: Microservice Enabling Microservices and Reactive Programming
Rick Hightower
 
Consul: Service-oriented at Scale
C4Media
 
Docker Service Registration and Discovery
m_richardson
 

What's hot (20)

PPTX
Microservices with docker swarm and consul
Nguyen Sy Thanh Son
 
PDF
Service discovery in mesos miguel, Angel Guillen
J On The Beach
 
PDF
Getting Started with Consul
Ramit Surana
 
PDF
Consul and Consul Pusher
Łukasz Cieśluk
 
PPTX
Building a Cloud Native Service - Docker Meetup Santa Clara (July 20, 2017)
Yong Tang
 
PDF
Service Discovery in Distributed Systems
Ivan Voroshilin
 
PDF
Comparing ZooKeeper and Consul
Ivan Glushkov
 
PDF
Prometheus meets Consul -- Consul Casual Talks
Satoshi Suzuki
 
PDF
Service Discovery 101
Stefan Achtsnit
 
PPTX
WebSocket MicroService vs. REST Microservice
Rick Hightower
 
PDF
Beyond static configuration
Stefan Schimanski
 
PDF
The Java Microservice Library
Rick Hightower
 
PDF
Designing a reactive data platform: Challenges, patterns, and anti-patterns
Alex Silva
 
PPTX
Cooking with Chef
m_richardson
 
PDF
Altitude SF 2017: Advanced VCL: Shielding and Clustering
Fastly
 
PDF
Single tenant software to multi-tenant SaaS using K8S
CloudLinux
 
PPTX
Intro to kubernetes
Elad Hirsch
 
PDF
Secrets in Kubernetes
Jerry Jalava
 
PDF
CI Provisioning with OpenStack - Gidi Samuels - OpenStack Day Israel 2016
Cloud Native Day Tel Aviv
 
PPTX
Service Discovery Like a Pro
Eran Harel
 
Microservices with docker swarm and consul
Nguyen Sy Thanh Son
 
Service discovery in mesos miguel, Angel Guillen
J On The Beach
 
Getting Started with Consul
Ramit Surana
 
Consul and Consul Pusher
Łukasz Cieśluk
 
Building a Cloud Native Service - Docker Meetup Santa Clara (July 20, 2017)
Yong Tang
 
Service Discovery in Distributed Systems
Ivan Voroshilin
 
Comparing ZooKeeper and Consul
Ivan Glushkov
 
Prometheus meets Consul -- Consul Casual Talks
Satoshi Suzuki
 
Service Discovery 101
Stefan Achtsnit
 
WebSocket MicroService vs. REST Microservice
Rick Hightower
 
Beyond static configuration
Stefan Schimanski
 
The Java Microservice Library
Rick Hightower
 
Designing a reactive data platform: Challenges, patterns, and anti-patterns
Alex Silva
 
Cooking with Chef
m_richardson
 
Altitude SF 2017: Advanced VCL: Shielding and Clustering
Fastly
 
Single tenant software to multi-tenant SaaS using K8S
CloudLinux
 
Intro to kubernetes
Elad Hirsch
 
Secrets in Kubernetes
Jerry Jalava
 
CI Provisioning with OpenStack - Gidi Samuels - OpenStack Day Israel 2016
Cloud Native Day Tel Aviv
 
Service Discovery Like a Pro
Eran Harel
 
Ad

Viewers also liked (20)

PDF
Introduction to HashiCorp Consul
Jackson dos Santos Olveira
 
PPTX
Azure resource manager deployment templates
Geremy Reiner
 
PPTX
Love yourself ~To be Only1, not No1~
龍太郎(Ryutaro) 井元(Imoto)
 
PDF
Service discovery and puppet
Marc Cluet
 
PDF
GIS on Rails
Pivorak MeetUp
 
PPT
Digital Nomading on Rails
Pivorak MeetUp
 
PDF
Functional Immutable CSS
Pivorak MeetUp
 
PDF
"Ruby meets Event Sourcing" by Anton Paisov
Pivorak MeetUp
 
PDF
UDD: building polyglot anti-framework by Marek Piasecki
Pivorak MeetUp
 
PDF
Espec |> Elixir BDD
Pivorak MeetUp
 
PPTX
Building component based rails applications. part 1.
Pivorak MeetUp
 
PPTX
Building Component Based Rails Applications. Part 2.
Pivorak MeetUp
 
PDF
Lightweight APIs in mRuby
Pivorak MeetUp
 
PDF
Pivorak Clojure by Dmytro Bignyak
Pivorak MeetUp
 
PDF
The Silver Bullet Syndrome by Alexey Vasiliev
Pivorak MeetUp
 
PDF
"5 skills to master" by Alexander Skakunov
Pivorak MeetUp
 
PDF
Trailblazer Introduction by Nick Sutterer
Pivorak MeetUp
 
PPTX
Права інтелектуальної власності в IT сфері.
Pivorak MeetUp
 
PDF
Overcommit for #pivorak
Pivorak MeetUp
 
Introduction to HashiCorp Consul
Jackson dos Santos Olveira
 
Azure resource manager deployment templates
Geremy Reiner
 
Love yourself ~To be Only1, not No1~
龍太郎(Ryutaro) 井元(Imoto)
 
Service discovery and puppet
Marc Cluet
 
GIS on Rails
Pivorak MeetUp
 
Digital Nomading on Rails
Pivorak MeetUp
 
Functional Immutable CSS
Pivorak MeetUp
 
"Ruby meets Event Sourcing" by Anton Paisov
Pivorak MeetUp
 
UDD: building polyglot anti-framework by Marek Piasecki
Pivorak MeetUp
 
Espec |> Elixir BDD
Pivorak MeetUp
 
Building component based rails applications. part 1.
Pivorak MeetUp
 
Building Component Based Rails Applications. Part 2.
Pivorak MeetUp
 
Lightweight APIs in mRuby
Pivorak MeetUp
 
Pivorak Clojure by Dmytro Bignyak
Pivorak MeetUp
 
The Silver Bullet Syndrome by Alexey Vasiliev
Pivorak MeetUp
 
"5 skills to master" by Alexander Skakunov
Pivorak MeetUp
 
Trailblazer Introduction by Nick Sutterer
Pivorak MeetUp
 
Права інтелектуальної власності в IT сфері.
Pivorak MeetUp
 
Overcommit for #pivorak
Pivorak MeetUp
 
Ad

Similar to Introduction to service discovery and self-organizing cluster orchestration. HashiCorp Serf and Consul (20)

PDF
OSDC 2014: Jochen Lillich - Dynamic infrastructure orchestration
NETWAYS
 
PDF
Service discovery like a pro (presented at reversimX)
Eran Harel
 
PPTX
Serf@devops pune
Rahul Khengare
 
PPTX
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
PDF
Mitchell Hashimoto, HashiCorp
Ontico
 
PDF
You got a couple Microservices, now what? - Adding SRE to DevOps
Gonzalo Maldonado
 
PPTX
Discover/Register Everything in consul
Leandro Totino Pereira
 
PDF
Consul: Service Mesh for Microservices
ArmonDadgar
 
PPTX
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
PPTX
Microservices pros and cons dark
Andrew Siemer
 
PDF
Soa with consul
Rajesh Sharma
 
PDF
Smart Services & Smart Clients - How Microservices Change the Way You Build a...
Neil Mansilla
 
PDF
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Ajeet Singh Raina
 
PDF
HashiStack. To the cloud and beyond...
Oleg Lobanov
 
PPTX
.NET microservices with Azure Service Fabric
Davide Benvegnù
 
PDF
PostgreSQL High-Availability and Geographic Locality using consul
Sean Chittenden
 
PPTX
Intro to Consul
Kristian Hellang
 
PDF
MySQL HA Orchestrator Proxysql Consul.pdf
YunusShaikh49
 
PDF
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
PROIDEA
 
PDF
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 
OSDC 2014: Jochen Lillich - Dynamic infrastructure orchestration
NETWAYS
 
Service discovery like a pro (presented at reversimX)
Eran Harel
 
Serf@devops pune
Rahul Khengare
 
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
Mitchell Hashimoto, HashiCorp
Ontico
 
You got a couple Microservices, now what? - Adding SRE to DevOps
Gonzalo Maldonado
 
Discover/Register Everything in consul
Leandro Totino Pereira
 
Consul: Service Mesh for Microservices
ArmonDadgar
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
Microservices pros and cons dark
Andrew Siemer
 
Soa with consul
Rajesh Sharma
 
Smart Services & Smart Clients - How Microservices Change the Way You Build a...
Neil Mansilla
 
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Ajeet Singh Raina
 
HashiStack. To the cloud and beyond...
Oleg Lobanov
 
.NET microservices with Azure Service Fabric
Davide Benvegnù
 
PostgreSQL High-Availability and Geographic Locality using consul
Sean Chittenden
 
Intro to Consul
Kristian Hellang
 
MySQL HA Orchestrator Proxysql Consul.pdf
YunusShaikh49
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
PROIDEA
 
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 

More from Pivorak MeetUp (20)

PDF
Lisp(Lots of Irritating Superfluous Parentheses)
Pivorak MeetUp
 
PDF
Some strange stories about mocks.
Pivorak MeetUp
 
PDF
Business-friendly library for inter-service communication
Pivorak MeetUp
 
PDF
How i was a team leader once
Pivorak MeetUp
 
PDF
Rails MVC by Sergiy Koshovyi
Pivorak MeetUp
 
PDF
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
 
PPTX
Ruby OOP (in Ukrainian)
Pivorak MeetUp
 
PDF
Testing in Ruby
Pivorak MeetUp
 
PDF
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Pivorak MeetUp
 
PDF
The Saga Pattern: 2 years later by Robert Pankowecki
Pivorak MeetUp
 
PDF
Data and Bounded Contexts by Volodymyr Byno
Pivorak MeetUp
 
PDF
Successful Remote Development by Alex Rozumii
Pivorak MeetUp
 
PDF
Origins of Elixir programming language
Pivorak MeetUp
 
PDF
Multi language FBP with Flowex by Anton Mishchuk
Pivorak MeetUp
 
PDF
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
Pivorak MeetUp
 
PDF
CryptoParty: Introduction by Olexii Markovets
Pivorak MeetUp
 
PDF
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
Pivorak MeetUp
 
PDF
GIS on Rails by Oleksandr Kychun
Pivorak MeetUp
 
PDF
Unikernels - Keep It Simple to the Bare Metal
Pivorak MeetUp
 
PDF
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
Pivorak MeetUp
 
Lisp(Lots of Irritating Superfluous Parentheses)
Pivorak MeetUp
 
Some strange stories about mocks.
Pivorak MeetUp
 
Business-friendly library for inter-service communication
Pivorak MeetUp
 
How i was a team leader once
Pivorak MeetUp
 
Rails MVC by Sergiy Koshovyi
Pivorak MeetUp
 
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
 
Ruby OOP (in Ukrainian)
Pivorak MeetUp
 
Testing in Ruby
Pivorak MeetUp
 
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Pivorak MeetUp
 
The Saga Pattern: 2 years later by Robert Pankowecki
Pivorak MeetUp
 
Data and Bounded Contexts by Volodymyr Byno
Pivorak MeetUp
 
Successful Remote Development by Alex Rozumii
Pivorak MeetUp
 
Origins of Elixir programming language
Pivorak MeetUp
 
Multi language FBP with Flowex by Anton Mishchuk
Pivorak MeetUp
 
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
Pivorak MeetUp
 
CryptoParty: Introduction by Olexii Markovets
Pivorak MeetUp
 
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
Pivorak MeetUp
 
GIS on Rails by Oleksandr Kychun
Pivorak MeetUp
 
Unikernels - Keep It Simple to the Bare Metal
Pivorak MeetUp
 
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
Pivorak MeetUp
 

Recently uploaded (20)

PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Exploring AI Agents in Process Industries
amoreira6
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
oapresentation.pptx
mehatdhavalrajubhai
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 

Introduction to service discovery and self-organizing cluster orchestration. HashiCorp Serf and Consul

Editor's Notes

  • #2: Hello everyone. My name is Andrey and this is Roman. We are going to give you a brief introduction into service discovery and self-organising cluster orchestration, what is service discovery, what tools can be used to make it and show you a demo of small web application cluster orchestrated by Hashicorp’s Serf.
  • #3: Modern application’s infrastructure consists of multiple hosts. Their configs are often not dynamic and have hard-coded IP-addresses, what may lead to difficulties with scaling and failure recovery. Imagine situation, when one of application servers in the picture fails and being rebuild with another IP. In the worst situation you have to change load balancer’s config, whitelist new app server’s IP in firewall rules of workers. You have some kind of monolithic architecture (very popular word today?). When the configuration changes infrequently, you don’t even need service discovery at all
  • #4: As application grows, you face the problem of scaling, when nodes are added to and removed from cluster in a reaction to some events or load change. For example you are running e-commerce service, and it is Black Friday, and you need to double your application servers number. Then, you need some kind of automatic failure recovery for the situation on previous slide. And in this changing environment you need to quickly answer questions like: “Who is DB master today?” or “Which IP’s do application nodes have?”. Now you need a way to detect devices in cluster, their health and services they provide and consume. It is called Service Discovery.
  • #5: We are introducing two tools by Hashicorp, which provide service discovery solutions. Serf and Consul.
  • #6: Serf. Decentralized solution for cluster membership, failure detection and orchestration. Lightweight and highly available.
  • #7: Serf solves 3 basic problems of Service discovery: membership, failure detection, events propagation.
  • #8: Serf cluster membership is based on fast and reliable gossip protocol. Members periodically exchange with messages, randomly selecting recipients from a list of known members. This allows events to be quickly propagated with cluster and allows nodes to react on them mostly instantly. Member join and member leave events can be handled by every node in a custom way.
  • #9: Serf is able to quickly detect failed members and notify all alive members within the cluster with member failed event. All alive members will be able to react member failed event in a seconds by executing handler scripts. Serf then will attempt to recover failed nodes membership by trying to connect to them periodically.
  • #10: In addition to three mentioned events (join, leave, failure) Serf allows to broadcast custom events and queries. Difference between events and queries is that events are built using “fire-and-forget” mechanism, while queries provide request-response mechanism. Custom events can be used to trigger deploys, update configuration and other things you don’t expect feedback from. Queries are used to gather information from members, for example load, health status or any other kind of data. Queries are not delivered to failed nodes, while events eventually reach the node.
  • #11: It sounds very cool, but what can we do with all this stuff?
  • #12: Using Serf it is easy to create cluster of application servers and load balancers. Load balancers will listen for changes in a list of application servers and update their configurations on-the-fly accordingly
  • #13: Same as above, when new Redis or Memcached nodes join cluster or some nodes fail or leave it, your proxy or application updates list of available Redis or Memcached servers.
  • #14: By using custom events, you can trigger deploy process on your servers. For example on deploy event, workers stop execution, application server starts to update code, cache servers begin warming cache and everything you need to perform deployment of your application.
  • #15: Similar to Web servers and Redis clusters, DNS records can be updated in seconds after any change in your cluster.
  • #16: By using queries you can build a simple request-response mechanism to gather health data or any kind of information you may need to receive from members of your cluster.
  • #17: While Serf does not provide full spectre of Service Discovery features, it easily fits in a role of Building block for Service Discovery, providing the information about what nodes are alive, what addresses do they have and what services do they provide.
  • #18: We made a simple demo to show how application server may react on DB failure. When DB node fails or goes down we want our app to show fancy maintenance mode page to users. We are going to build the solution using Serf and Nginx as a web server on application node. Nginx configuration is pretty default, when there is a maintenance.txt file in a document root directory, we are returning service unavailable HTTP status code and show a maintenance page.
  • #19: Shutdown of DB node, triggers member-failed event, that gets quickly propagated within this small Serf cluster. Event handler script is simple. It creates maintenance.txt file in a document root causing nginx to show Service Unavailable page.
  • #20: When DB node brings up, member-join event handler removes that file and Nginx starts to perform in a normal mode. We made a short video to show Serf in action.
  • #22: While Serf is a low level solution of Service Discovery problem, Hashicorp offers a high level, more complex and feature rich product - Consul.
  • #23: Problems being solved by consul are: Service Discovery, Health Checking, Multi Datacenter clusters and Data storage.
  • #24: Consul clients can provide a service, such as api or mysql, and other clients can use Consul to discover providers of a given service. Using either DNS or HTTP, applications can easily find the services they depend upon.
  • #25: Consul clients can provide any number of health checks, either associated with a given service ("is the webserver returning 200 OK"), or with the local node ("is memory utilization below 90%"). Combining Service Discovery information and Health Checks you can automatically route traffic away from failing members.
  • #26: Consul supports multiple datacenters out of the box. This means users of Consul do not have to worry about building additional layers of abstraction to grow to multiple regions.
  • #27: Consul has built-in key/value storage which can be used for any number of purposes such as dynamic configuration, feature flagging, coordinaion, leader election and so on. The simple HTTP API makes it easy to use.
  • #28: This is a typical cluster using Consul schema. It includes two datacenters, 3 Consul servers and some number of clients in each. Client communicate with each other and consul servers using Gossip protocol. Consul servers provide cluster operation and key value storage.
  • #29: Let’s compare Serf and Consul. While Serf is fully decentralized and does not require any central servers, Consul requires to run at least one, 3 or five is better to achieve redundancy, servers to provide cluster operation and it’s services. Out of the box Serf provides only dead or alive health check, while Consul has a lot of built in health checks. Serf (gossip protocol actually) is designed to operate within LAN, but it is possible to use it over WAN but with degraded performance. Consul has built-in multi datacenter support. Serf is more flexible, general-purpose tool, a building block for Service Discovery solutions
  • #30: To sum everything up. Nowdays, configurations can be dynamic, and can he interpeted as a code.
  • #31: By the way, Hashicorp supports a bunch of great tools, they are: vagrant - tool to create and configure reproducible development environments under virtualbox, vmware, docker and most of common cloud providers. We used vagrant to spin up virtual machines in demo videos. Packer is a tool for creating images for platforms like Amazon AWS, Openstack, VMware from a single configuration file. Terraform is aimed to infrastructure management. Vault is secure storage for sensitive information like access keys, tokens and passwords. Nomad was created to manage and schedule applicaiton on given resources provided for example by Terraform. And the last one is Otto a tool capable of automatically detecting your application type, creating development environment for and managing process of its deployment. So as you can see Good corporation Hashicorp has many tools to make developer’s or devops’s life much easier.