Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the marathon healthChecks?

Tags:

marathon

I execute git clone https://github.com/mesosphere/marathon.git to download the latest marathon,And I had known from marathon doc that we can set the property of 'healthChecks' to Monitor the job.

but when i start marathon , i can't find the property 'healthChecks' anywhere,

And i am sure that the marathon i had download is the latest.

anybody could tell me how to use the 'healthChecks' ?

this is the marathon doc for 'healthChecks'

And you can see it on http://mesosphere.github.io/marathon/docs/rest-api.html#post-v2-apps

 "healthChecks": [
    {
        "protocol": "HTTP",
        "path": "/health",
        "gracePeriodSeconds": 3,
        "intervalSeconds": 10,
        "portIndex": 0,
        "timeoutSeconds": 10,
        "maxConsecutiveFailures": 3
    },
    {
        "protocol": "TCP",
        "gracePeriodSeconds": 3,
        "intervalSeconds": 5,
        "portIndex": 1,
        "timeoutSeconds": 5,
        "maxConsecutiveFailures": 3
    },
    {
        "protocol": "COMMAND",
        "command": { "value": "curl -f -X GET http://$HOST:$PORT0/health" },
        "maxConsecutiveFailures": 3
    }
],
like image 740
KingOfSocket Avatar asked Sep 16 '15 10:09

KingOfSocket


1 Answers

The Health Checks doc page provides detailed information on how to use them.

Screen shot of Health Checks in Marathon 0.11

Note that health checks are application dependent, which means you have to implement them in your app and expose them since only you know what constitutes a healthy state in your app.

For example, Marathon itself has the /ping URL which indicates a basic availability of the service.

like image 197
Michael Hausenblas Avatar answered Oct 18 '22 16:10

Michael Hausenblas