Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mesos + Consul = Developer Happiness
Search
Brian Hicks
July 09, 2015
Programming
3
920
Mesos + Consul = Developer Happiness
Talk given to the Denver Mesos Usergroup on July 9th, 2015
Brian Hicks
July 09, 2015
Tweet
Share
More Decks by Brian Hicks
See All by Brian Hicks
Esperanto
brianhicks
0
120
Snake Snacks: Function Composition, The Dumb Way
brianhicks
0
100
Make Snacks: Yet Another JavaScript Build System
brianhicks
0
70
State of Elm 2017
brianhicks
1
490
µKanren: A Minimal Functional Core for Relational Programming
brianhicks
0
400
Terraform All The Things!
brianhicks
2
350
Kubernetes for the Mesos User
brianhicks
1
92
ch-ch-ch-ch-changes in Elm 0.17.0
brianhicks
2
1.8k
State of Elm 2016
brianhicks
3
510
Other Decks in Programming
See All in Programming
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
590
Amazon Nova Reelの可能性
hideg
0
200
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
450
Beyond ORM
77web
11
1.6k
ASP.NET Core の OpenAPIサポート
h455h1
0
120
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.1k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
116
7.1k
How STYLIGHT went responsive
nonsquared
96
5.3k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
Gamification - CAS2011
davidbonilla
80
5.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Automating Front-end Workflow
addyosmani
1366
200k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Code Review Best Practice
trishagee
65
17k
It's Worth the Effort
3n
183
28k
Transcript
Mesos+Consul= Developer Happiness
Brian Hicks @brianhicks
None
None
OXY HAPROXY client SERVER
marathon-consul haproxy-Consul
Service discovery and configuration made easy. Distributed, highly available, and
datacenter-aware. consul.io
(and DNS) SERVICES
[{ "Address": "10.0.113.214", "Node": "batman-control-01", "ServiceAddress": "", "ServiceID": "marathon", "ServiceName":
"marathon", "ServicePort": 18080, "ServiceTags": ["marathon"] }] curl localhost:8500/v1/catalog/service/marathon Query a Service over HTTP
216.58.216.206 dig +short www.google.com DNS
10.0.113.214 10.0.220.54 10.0.131.25 1 1 18080 batman-control-02.node.batman.consul. 1 1 18080
batman-control-03.node.batman.consul. 1 1 18080 batman-control-01.node.batman.consul. dig +short marathon.service.consul dig +short marathon.service.consul SRV SRV Records
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
curl http://localhost:8500/v1/agent/service/register \ -d @marathon.json REgistering the Service
& Q A
and Values) (and Values) Keys
true [{ "CreateIndex": 223, "Flags": 0, "Key": "hello", "LockIndex": 0,
"ModifyIndex": 223, "Value": "d29ybGQ=" }] curl -X PUT -d world http://localhost:8500/v1/kv/hello curl -X GET http://localhost:8500/v1/kv/hello Setting and Retrieving
true false curl -X PUT -d denver http://localhost:8500/v1/kv/hello?cas=223 curl -X
PUT -d world http://localhost:8500/v1/kv/hello?cas=1 Check and Set
WAtches HTTP/1.1 200 OK Content-Type: application/json X-Consul-Index: 226 X-Consul-Knownleader: true
X-Consul-Lastcontact: 0 Date: Mon, 29 Jun 2015 16:25:45 GMT Content-Length: 96 curl http://localhost:8500/v1/kv/hello?index=226
consul-template This project provides a convenient way to populate values
from Consul into the filesystem using the consul-template daemon. github.com/hashicorp/consul-template
Haproxy Template global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults
mode http timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}}
Haproxy Template global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults
mode http timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}}
Haproxy Template global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults
mode http timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}}
Haproxy Template global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults
mode http timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}}
global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults mode http
timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}} Haproxy Template
global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults mode http
timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}} Haproxy Template
& Q A
(yes, we're getting a new name) microservices-infrastructure Github.com/CiscoCloud/microservices-infrastructure Microservices infrastructure
is a modern platform for rapidly deploying globally distributed services
Components
@brianhicks //
[email protected]
@ASteris_LLC //
[email protected]
Colophon Eggs. Plenty of them. Alex Barth, Licensed CC BY
2.0 https://www.flickr.com/photos/a-barth/4985481182 Dictionary Greeblie, Licensed CC BY 2.0 https://www.flickr.com/photos/greeblie/3338710223