Service Discovery and Load Balancing

Service Discovery and Load Balancing

DC/OS provides a number of tools out-of-the-box, ranging from basic network connectivity between containers to more advanced features, such as load balancing and service discovery. Here’s an overview of the options, with some general guidelines on what to use in which situations.

Tool Type When should I use it?
VIPs (Minuteman) A layer 4 load balancer, which can be used for most TCP traffic for any Mesos task within a DC/OS cluster. When you have internal-only TCP services which do not require layer 7 features.
Marathon-LB Marathon-LB is an HAProxy based load balancer for Marathon only. When you require external routing or layer 7 load balancing features. Examples of layer 7 features include: TLS termination, zero-downtime deployments, HTTP sticky sessions, load balancing algorithm customization, network ACLs, HTTP basic auth, gzip compression, and more.
Mesos-DNS Mesos-DNS is a basic DNS-based service discovery tool that works with any Mesos task. When VIPs or Marathon-LB are not adequate, you can use the auto-generated Mesos-DNS names. For example, to discover Marathon-LB you’d use Mesos-DNS by connecting to Marathon-LB with marathon-lb.marathon.mesos. Or, if you have UDP services such as StatsD.

Marathon-LB

Marathon-LB is based on HAProxy, a rapid proxy and load balancer. HAProxy provides proxying and load balancing for TCP and HTTP based applications, with features such as SSL support, HTTP compression, health checking, Lua scripting and more. Marathon-LB subscribes to Marathon’s event bus and updates the HAProxy configuration in real time.

Mesos-DNS

Mesos-DNS provides service discovery within DC/OS clusters. It is fully integrated into DC/OS and allows applications and services on the cluster to find each other through the domain name system (DNS), similar to how services discover each other throughout the Internet.

Using Virtual IP Addresses

Ports management in Marathon is a powerful and complex feature: many configurations are possible depending on the type of container and the specific requirements.

    Discovering DNS Names

    You can get a comprehensive list of the apps being run on your DC/OS cluster nodes.

      Load Balancing and VIPs

      DC/OS comes with an east-west load balancer that’s meant to be used to enable multi-tier microservices architectures. It acts as a TCP Layer 4 load balancer, and it’s tightly integrated with the kernel.