2017-12-18 139 views
-2

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

+0

投票关闭作为题外话,因为它基本上要求的教程,这是外的范围。话虽如此,这可能对你有帮助:https://skillsmatter.com/skillscasts/11183-integration-testing-using-sbt-scalatest-and-docker – theFunkyEngineer

+0

这是一次在马拉松上运行还是永久运行在马拉松上? – Rico

+0

它永久运行在马拉松上。一次运行,我通过命令“sbt docker”执行。我配置的Scalatest案例将运行并创建图像。问题是在部署到Marathon之后,我如何在异步应用程序上使用马拉松的运行状况检查功能。 –

回答

0

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

想想你是否真的需要健康检查以及它会告诉你什么。避免进行健康检查,以更好地利用资源,暴露将监视线程池的终端,超时e.t.c.并且当某些事情真的错误时会返回不健康的状态。在其他情况下,您应该配置您的指标以通知您发生了不良事件。

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.

+1

谢谢大家。现在我写了一个哑健康检查HTTP服务。 –

相关问题