• No results found

CONSUL AS A MONITORING SERVICE

N/A
N/A
Protected

Academic year: 2021

Share "CONSUL AS A MONITORING SERVICE"

Copied!
85
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

SETH VARGO

(3)
(4)

SERVICE

ORIENTED

(5)

SOA  PRIMER

Autonomous

Limited Scope

(6)

ORDER

PROCESSING

WEB APP

HISTORY

ORDER

(7)

ORDER

PROCESSING

WEB APP

DISCOVERY

(8)

ORDER

PROCESSING

WEB APP

LOAD  BALANCING

How to ensure request leveling across providers?

NODE 1 NODE 2 NODE N

(9)

ORDER

PROCESSING

WEB APP

ANTI-­‐PATTERN

Load Balancer is a Single Point of Failure (SPOF)

NODE 1 NODE 2 NODE N LOAD

(10)

ORDER

PROCESSING

WEB APP

HEALTH  CHECKING

How to avoid routing to unhealthy hosts?

NODE 1 NODE 2 NODE 3 LOAD

(11)

WEB APP

CONFIGURATION

How to efficiently push dynamic configuration?

WEB 1 WEB 2 WEB N maintenance: false feature_a: true role: "web"

(12)

SERVICE  

DISCOVERY BALANCINGLOAD   CHECKINGHEALTH   CONFIGURATIONKEY-­‐VALUE  

(13)

ZOOKEEPER ETCD SENSU SMART  STACK

EXISTING  "SOLUTIONS"

(14)
(15)

Service Discovery

HTTP + DNS

(16)
(17)

; <<>> 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

(18)
(19)

CLIENT CLIENT CLIENT CLIENT CLIENT CLIENT

SERVER SERVER SERVER

REPLICATION REPLICATION

RPC

RPC LAN  GOS

(20)

CLIENT CLIENT CLIENT CLIENT CLIENT CLIENT

SERVER SERVER SERVER

REPLICATION REPLICATION RPC RPC LAN  GOS SIP SERVER SERVER SERVER REPLICATION REPLICATION

(21)

CLIENT CLIENT CLIENT CLIENT CLIENT CLIENT

SERVER SERVER SERVER

REPLICATION REPLICATION RPC RPC LAN  GOS SIP SERVER SERVER SERVER REPLICATION REPLICATION

(22)

Host & Service

(23)

> listen http-in bind *:8000 server web-0 127.0.0.1:80 server web-1 127.0.0.1:80 server web-2 127.0.0.1:80

demo  master consul-template -template="example.ctmpl" -dry

(24)

> listen http-in bind *:8000 server web-0 127.0.0.1:80 server web-1 127.0.0.1:80 server web-2 127.0.0.1:80

demo  master consul-template -template="example.ctmpl" -dry

(25)

>

listen http-in bind *:8000

server web-1 127.0.0.1:80 server web-2 127.0.0.1:80

demo  master consul-template -template="example.ctmpl" -dry

(26)

> listen http-in bind *:8000 server web-0 127.0.0.1:80 server web-1 127.0.0.1:80 server web-2 127.0.0.1:80

demo  master consul-template -template="example.ctmpl" -dry

(27)

K/V Store

HTTP API

(28)

true

(29)

true

demo  master curl -X PUT -d 'bar' http://localhost:8500/v1/kv/foo

[ { "CreateIndex": 100, "ModifyIndex": 200, "Key": "foo", "Flags": 0, "Value": "YmFy" } ]

(30)
(31)

HEALTH

CHECKS

(32)

WHAT  IS  A  CHECK?

(33)

WHAT  IS  A  CHECK?

Any command that returns an exit code

0

PASSING

1

WARNING

__

FAILING

(34)

WHAT  IS  A  CHECK?

Output is captured as a "note" for inspection

curl: (7) Failed to connect to 127.0.0.1 port 4455: Connection refused $ curl http://127.0.0.1:4455/_health

(35)

CREATING  A  CHECK

Use a custom script

{

"check": {

"id": "mem-util",

"name": "Memory utilization",

"script": "/usr/local/bin/check_mem.py", "interval": "10s"

} }

(36)

CREATING  A  CHECK

Use a built-in check type

{

"check": {

"id": "api",

"name": "HTTP API on port 4455",

"http": "http://localhost:4455/_health", "interval": "10s",

"timeout": "1s" }

(37)
(38)
(39)
(40)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

(41)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

(42)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

(43)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

(44)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

(45)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

U

(46)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Pushes information into a silo

WEB 1 WEB 2 WEB N

U

(47)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N

(48)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N

(49)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.4 10.0.1.5 10.0.1.6

(50)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.4 10.0.1.5 10.0.1.6

(51)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.5 10.0.1.6

(52)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.5 10.0.1.6 host: web.service.consul

(53)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.5 10.0.1.6 host: web.service.consul

(54)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.5 10.0.1.6 host: web.service.consul

(55)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.5 10.0.1.6 host: web.service.consul

(56)

CONSUL

CONSUL  MONITORING

Removes unhealthy nodes from service discovery layer

WEB 1 WEB 2 WEB N dig web.service.consul 10.0.1.4 10.0.1.5 10.0.1.6 host: web.service.consul

(57)

CONSUL  MONITORING

Unhealthy nodes are not returned from DNS queries

(58)

CONSUL  MONITORING

Unhealthy nodes are not returned from HTTP API

(59)
(60)

CONSUL  LOCK

Allows for a new kind of "HA"

(61)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

(62)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

L

L

(63)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

(64)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

L

LEADER  ELECTION

(65)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

L

GET /secret/foo REQUEST

(66)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

L

GET /secret/foo REQUEST

(67)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

L

GET /secret/foo REQUEST

(68)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

(69)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2 VAULT 3

(70)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2

(71)

CONSUL  LOCK

Making standby HA much simpler

CONSUL

VAULT 1 VAULT 2

(72)

CONSUL  LOCK

Making standby HA much simpler

VAULT 1 VAULT 2 VAULT 3 GET /secret/foo REQUEST

CONSUL

L

(73)

CONSUL  LOCK

Making standby HA much simpler

VAULT 1 VAULT 2 VAULT 3 GET /secret/foo REQUEST

CONSUL

L

(74)

CONSUL  LOCK

(75)

CONSUL  LOCK

(76)
(77)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Notifies/polls all statuses

WEB 1 WEB 2 WEB N

"I'm healthy"

"Good,

thanks for a

(78)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Notifies/polls all statuses

WEB 1 WEB 2

WEB 1,000

1,000'S OF

REQUESTS

(79)

MONITORING

SERVICE

TRADITIONAL  MONITORING

Notifies/polls all statuses

WEB 1 WEB 2 WEB 1,000

1,000'S OF

REQUESTS

HA

(80)

CONSUL

WEB 1 WEB 2 WEB N My status ha s changed

CONSUL  MONITORING

(81)

CONSUL

CONSUL  MONITORING

Notifies on status changes

WEB 1 WEB 2

WEB 1,000

10'S OF

(82)
(83)

SERVICE  

DISCOVERY BALANCINGLOAD   CHECKINGHEALTH   CONFIGURATIONKEY-­‐VALUE  

(84)

9

H

G

L

RESPONSIVE LEADER  

ELECTION SEMAPHORE  LOCKING SCALABLE

(85)

SETH VARGO

@sethvargo

References

Related documents

They very clearly state that they don't accept GAC advice to consider governments' comments when they do not relate to confusion, because this is the standard that is established

— Sutural angle of elytra without small tooth; head, antennae, scutellum, legs, and venter (except abdominal sterna laterally) black; pronotum yellow with disc black from base to

This model posits four types of health beliefs that affect an individual’s health behavior, in this case, the decision to seek mental health services: perceived

Make measurements on timeslot 0 [FREQUENCY] {Timeslot Off} [Enter] Activate the ORFS measurement (figure 25) [MEASURE] {GMSK Output RF The default setting measures spectrum

Using a nationwide database of hospital admissions, we established that diverticulitis patients admitted to hospitals that encounter a low volume of diverticulitis cases have

The aim of this paper was to explore the effects on the French forest sector of three policies to mitigate climate change: a fuelwood consumption subsidy (substitution), a payment

de Klerk, South Africa’s last leader under the apartheid regime, Mandela found a negotiation partner who shared his vision of a peaceful transition and showed the courage to

Silicon Valley San Francisco San Francisco Peninsula Austin Seattle Raleigh-Durham Salt Lake City Denver Boston Baltimore New York Washington DC San Diego Pittsburgh