Book Image

Microservices Deployment Cookbook

By : Vikram Murugesan
Book Image

Microservices Deployment Cookbook

By: Vikram Murugesan

Overview of this book

This book will help any team or organization understand, deploy, and manage microservices at scale. It is driven by a sample application, helping you gradually build a complete microservice-based ecosystem. Rather than just focusing on writing a microservice, this book addresses various other microservice-related solutions: deployments, clustering, load balancing, logging, streaming, and monitoring. The initial chapters offer insights into how web and enterprise apps can be migrated to scalable microservices. Moving on, you’ll see how to Dockerize your application so that it is ready to be shipped and deployed. We will look at how to deploy microservices on Mesos and Marathon and will also deploy microservices on Kubernetes. Next, you will implement service discovery and load balancing for your microservices. We’ll also show you how to build asynchronous streaming systems using Kafka Streams and Apache Spark. Finally, we wind up by aggregating your logs in Kafka, creating your own metrics, and monitoring the metrics for the microservice.
Table of Contents (15 chapters)
Microservices Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Load balancing your microservice using Marathon LB


In this recipe, we will learn the concepts of Marathon LB and how it works behind the screens. At the time of writing this, Marathon LB works perfectly with DC/OS. So trying to make Marathon LB work in a non-DC/OS environment might not be the best solution in all cases. We will be learning about DC/OS in Chapter 8 , More Clustering Frameworks - DC/OS, Docker Swarm, and YARN.

How it works...

Marathon LB is a Python-based tool that internally uses HAProxy to load-balance applications deployed on Marathon. HAProxy is one of the proven solutions for load-balancing HTTP-based endpoints. It has been there in the market for a while, and there are several success stories about it. When you start Marathon LB, you need to supply the base URL of Marathon as a configuration so that when Marathon LB starts, it knows where Marathon is running on your cluster. Marathon LB binds to the service ports of all the applications and routes any request that it...