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

Configuring volumes in Marathon


So far, we have learned how to deploy our microservice on a Mesos cluster using Marathon and configure ports using Marathon's web UI. One of the most common things you would want to do is be able to map volumes in your container to the host machine. Though this is not something that is super important to our geolocation application, when you deal with applications that save files on the filesystem, this is critical. You wouldn't want to lose your data, would you? In this recipe, we will look at how to map volumes using Marathon.

Getting ready

In order to learn how to configure volume mapping in Marathon, let's make our application save something to the filesystem. Let's say the geolocation application would like to store the geolocation JSON to the filesystem as it receives them. It might not be a great design, but for our understanding, let's make our geolocation application store the geolocation JSON files in a dedicated data directory as and when they arrive...