Burak Tokgöz
Story dweller
Burak Tokgöz
DNS server plus Consistent Key/Value Store + ZooKeeper + Nagios + ... = Consul
All the bits you need in a coherent model available to provide service discovery and replicated config
Maintains:
Set of service
Check registrations
Health information
Updates:
Health checks
Local state
Text
Local agent state( agent client node) is different than catalog state(agent server node)
Local Agent notifies Catalog of changes. Updates are synced right away.
Agents check to make sure its view of world matches the catalog and if not the catalog is updated
Example: Registers a new service check with agent,
Agent notifies catalog that this service check exists
When a check is removed from the agent, it is removed from the catalog
If Agents run health checks and status changes then update is sent to catalog
Agent is the authority of that node and the services that exist on that node
Scope
Agent = Server or Virtual Machine
Catalog = single datacenter, local area network, EC2 availability zone
Changes are also synchronized periodically every minute to ten minutes
Clients
Agent
Agent
Agent
Servers
Agent
Agent
Agent
RPC
Gossip
Leader
Rails and Data Services
Web Server
Discovery
Rails and Data Services
Web Server
Discovery
Dynamically renders templates
Integrate with everything
Reload changes
Real-time
Consul templates to update files and possibly restart applications (haproxy with backend servers)
global
daemon
maxconn {{key "service/haproxy/maxconn"}}
defaults
mode {{key "service/haproxy/mode"}}{{range ls "service/haproxy/timeouts"}}
timeout {{.Key}} {{.Value}}{{end}}
listen http-in
bind *:8000{{range service "release.web"}}
server {{.Node}} {{.Address}}:{{.Port}}{{end}}
Consul Template Example:
Render template based on Consul state
Setup reverse proxy: Nginx, Apache, haproxy
My Network
Node1
HAProxy
Agent
Frontend
Backend
Consul Server
By Burak Tokgöz
consul brief explanation and usage