通过 SBT 对 Dockerized Scala 应用程序进行马拉松式健康检查

Marathon Healthcheck for Dockerized Scala Application via SBT

我正在使用 Marathon 和 Mesos。我的应用程序基于 Scala,我正在使用 SBT docker 插件来 docker 化应用程序并部署到 Marathon。这些应用程序是异步的(基于队列的)并且不通过 HTTP 调用。我如何为异步应用程序执行健康检查,是否可以在此处利用 SBT Scalatest。该应用程序是 docker 化的,那么我们如何在 docker 化的应用程序中调用 Scalatest。有什么想法吗?

您可以使用 Command HealthCheck 并执行自定义命令。

想想你是否真的需要健康检查,它会告诉你什么。避免消耗资源的健康检查更好地暴露将监视线程池、超时 e.t.c 的端点。和 returns 不健康的时候确实有问题。在其他情况下,您应该配置指标以通知您发生了不好的事情。

Process health checking (“is this binary responding at all?”) and service health checking (“is this binary able to respond to this class of requests right now?”) are two conceptually distinct operations. Process health checking is relevant to the cluster scheduler, whereas service health checking is relevant to the load balancer. Clearly distinguishing between the two types of health checks can help avoid this scenario.