Service discovery in mesos
-
Upload
miguel-a-guillen-tarazaga -
Category
Technology
-
view
312 -
download
0
Transcript of Service discovery in mesos
![Page 1: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/1.jpg)
Service discovery in Mesos Cluster
Miguel Angel GuillenAeriaGames GmbH
![Page 2: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/2.jpg)
Who am I?
● From Elche(Spain)● Working in Berlin
in AeriaGames● DevOps,Sysadmin,
SRE, etc…● Video Games
![Page 3: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/3.jpg)
AERIA GAMES
Different partners and technologies
![Page 4: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/4.jpg)
Mesos
● Cluster resources● Supports docker containers● Is really cool● Mesos and Beyond was before this talk!!
![Page 5: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/5.jpg)
Service discovery
“Service discovery tools manage how processes and services in a cluster can find
and talk to one another.”
![Page 6: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/6.jpg)
DNS
● More basic service discovery● But A records are really simple ● SRV records are really useful● Few services supports SRV
![Page 7: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/7.jpg)
Service Discovery tools
● Provides a service registry system● Integrates with an API● Provides meta-data of the service● Use or provides a K/V store● It provides libraries and tools
![Page 8: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/8.jpg)
Service Discovery tools
● ZookeeperK/V storelibraries
● ETCDK/V storelibrariesREST API
● ConsulK/V storelibrariesREST APIDNS
● All can be used as K/V store for all kind of usage
![Page 9: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/9.jpg)
Mesos
![Page 10: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/10.jpg)
Mesos
![Page 11: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/11.jpg)
![Page 12: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/12.jpg)
Zookeeper
● ZookeeperK/V storelibraries
● NO YET REST OR DNS!*● Only library support**
* REST is WIP
** you can use confd for reading, but set data is still from lib or zkshell
![Page 13: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/13.jpg)
What I should do?
● There is other options● mesos-dns● marathon-dns● marathon-lb
● The problem is if service discovery pattern fits in your needs
![Page 14: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/14.jpg)
Service Discovery Patterns
● Client-Side Discovery Pattern– The client is responsible for determining the
network locations– Load balancing is managed by the client– Usually client supports service discovery
with a library integrated (zookeeper)
![Page 15: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/15.jpg)
Service Discovery Patterns
● The Server-Side Discovery Pattern– The client makes a request to a service via a
load balancer– Client don’t know the service, only load
balancer– Load Balancer use service registry via DNS
or other kind of integrations.
![Page 16: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/16.jpg)
Service Discovery Antipatternsin microservices
Server side discovery – We add an extra hop– Load balancer as SpoF
● Or scale with the microservice
– Adds complexity to the architecture
![Page 17: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/17.jpg)
And Finally…. In Mesos
![Page 18: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/18.jpg)
Layers
Marathon
Mesos
Docker RegistratorRegistrator
Mesos-dnsMesos-dns
Marathon-lbMarathon-lb
consul RegistratorRegistrator
Mesos-consul
![Page 19: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/19.jpg)
Service Discovery in mesos
Registrator– Reads the event bus of docker and adds the
service to a service registry● Application is removed from the registry when
docker container is stopped.
– If the host crash the services are still registered
● If the host is recovered problems can appear
– There are better solutions for using with mesos
![Page 20: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/20.jpg)
Mesos-consul
mesos-consul● “Mesos-consul automatically registers/deregisters
services run as Mesos tasks.”● Can be deployed in mesos as task or marthon app● Depends on consul as service registry● Use a lot of the features of consul like tags● Develop for mantl(CiscoCloud)
![Page 21: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/21.jpg)
Service Discovery in mesos
Mesos-DNS
“Mesos-DNS enables DNS based service discovery in Apache Mesos clusters.”
● Supports SRV records● It has special records for marathon
– Ex: leading master: A record (leader.domain) and SRV records (_leader._tcp.domain and _leader._udp.domain)
● Supports round robin for multiple tasks with the same name
![Page 22: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/22.jpg)
Service Discovery in mesos
![Page 23: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/23.jpg)
Service discovery in mesos/marathon
Marathon-lb“Marathon-lb is a tool for managing HAProxy, by consuming Marathon's app state”
● Server side service discovery● Deployable in marathon it self● Depends on marathon● Is included in DCOS
![Page 24: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/24.jpg)
?
![Page 25: Service discovery in mesos](https://reader036.fdocumento.com/reader036/viewer/2022062522/58a9ab861a28ab9c758b57f1/html5/thumbnails/25.jpg)
Vielen Dank!!