25
Service discovery in Mesos Cluster Miguel Angel Guillen AeriaGames GmbH

Service discovery in mesos

Embed Size (px)

Citation preview

Page 1: Service discovery in mesos

Service discovery in Mesos Cluster

Miguel Angel GuillenAeriaGames GmbH

Page 2: Service discovery in mesos

Who am I?

● From Elche(Spain)● Working in Berlin

in AeriaGames● DevOps,Sysadmin,

SRE, etc…● Video Games

Page 3: Service discovery in mesos

AERIA GAMES

Different partners and technologies

Page 4: Service discovery in mesos

Mesos

● Cluster resources● Supports docker containers● Is really cool● Mesos and Beyond was before this talk!!

Page 5: Service discovery in mesos

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

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

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

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

Mesos

Page 10: Service discovery in mesos

Mesos

Page 11: Service discovery in mesos
Page 12: Service discovery in mesos

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

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

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

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

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

And Finally…. In Mesos

Page 18: Service discovery in mesos

Layers

Marathon

Mesos

Docker RegistratorRegistrator

Mesos-dnsMesos-dns

Marathon-lbMarathon-lb

consul RegistratorRegistrator

Mesos-consul

Page 19: Service discovery in mesos

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

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

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

Service Discovery in mesos

Page 23: Service discovery in mesos

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

?

Page 25: Service discovery in mesos

Vielen Dank!!