0

buddies

I am wondering how marathon get to know a serice instance is ready to service?

Is there any interface to customize the health check during the starting up of a instance?

thanks

yuankui
  • 162
  • 2
  • 10

2 Answers2

1

Have a look at the docs at

You can implement a variety of checks, not only on http endpoints, but also tcp... For example, if you're starting a dockerized MySQL service, you could perform a health check on tcp port 3306 to verify that MySQL is actually started and reachable:

"healthChecks": [
    {
        "portIndex": 0,
        "protocol": "TCP",
        "intervalSeconds": 1,
        "timeoutSeconds": 2,
        "maxConsecutiveFailures": 5
    }
]

To be dynamic, the portIndex is important. So for example, you used bridged networking with Docker, and Marathon chooses the port automatically (and you only exposed on port), then the portIndex needs to be set to one.

Also, if you want immediate health check upon startup (i.e. the task should not be considered as RUNNING until everything's up), you'll need to omit the gracePeriodSeconds parameter.

rado
  • 4,040
  • 3
  • 32
  • 26
Tobi
  • 31,405
  • 8
  • 58
  • 90
  • What is the difference between `readinessChecks` and `healthChecks` ? => https://mesosphere.github.io/marathon/docs/readiness-checks.html – Dimitri Kopriwa Dec 11 '19 at 12:23
0

You can use healthcheck but there is also a readinessChecks. https://github.com/mesosphere/marathon/blob/master/docs/docs/readiness-checks.md

There is also the minimumHealthCapacity in the upgrades strategy https://mesosphere.github.io/marathon/docs/rest-api.html#upgrade-strategy

JasonG
  • 5,794
  • 4
  • 39
  • 67