Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Latest commit

 

History

History
25 lines (17 loc) · 1.67 KB

2016-04-23-marathon-health-checks.md

File metadata and controls

25 lines (17 loc) · 1.67 KB
layout title categories author lang
post
Health checks with Marathon
Docker
devatoria
en

Health checks are useful to ensure that your containers are running; and even better, are behaving as expected. If your container is found to be unhealthy, it will be automatically redeployed. You can add multiple health checks per application. Marathon supports both high level HTTP and lower level TCP health checks.

HTTP checks allow for better, higher level checks on a specific URL like http://localhost:port/my/health/path. It automatically ignores informational status codes in the range 100 to 199.

Configure a health check for a nginx application

In one of the previous tutorials, we deployed and ran a simple nginx container on Marathon. Let's now configure some HTTP health check for this application.

Main interface

  • Grace Period: health check failures are ignored within this number of seconds or until the task becomes healthy for the first time (useful if you have a task with a long startup time, to avoid having the health check failing because of this).
  • Interval: number of seconds to wait between each health check
  • Timeout: number of seconds after which a health check is considered a failure regardless of the response.

##Configure the port to check

There are two ways to configure the port to check: by port index or by port number. By default, the port is passed by index: 0 is the first port you passed in the port mapping configuration, 1 is the second one, etc. You can also specify a port by simply choosing the port number type.