2017-12-18 223 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服務。 –

相關問題