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
68
State of Elm 2017
brianhicks
1
480
µKanren: A Minimal Functional Core for Relational Programming
brianhicks
0
400
Terraform All The Things!
brianhicks
2
340
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
500
Other Decks in Programming
See All in Programming
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
300
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
Beyond ORM
77web
7
920
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
700
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
140
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
830
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
140
MCP with Cloudflare Workers
yusukebe
2
220
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Mobile First: as difficult as doing things right
swwweet
222
9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Site-Speed That Sticks
csswizardry
2
190
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The Language of Interfaces
destraynor
154
24k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Embracing the Ebb and Flow
colly
84
4.5k
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