如何使用马拉松健康检查?
How to use the marathon healthChecks?
我执行git clone https://github.com/mesosphere/marathon.git
下载最新的marathon,而且我从marathon doc知道我们可以设置'healthChecks'的属性来监控作业。
但是当我开始马拉松比赛时,我在任何地方都找不到 属性 'healthChecks',
而且我确定我下载的马拉松是最新的。
谁能告诉我如何使用 'healthChecks' ?
这是 'healthChecks'
的马拉松文档
你可以在 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
}
],
Health Checks doc 页面提供了有关如何使用它们的详细信息。
请注意,健康检查依赖于应用程序,这意味着您必须在您的应用程序中实施它们并公开它们,因为只有您知道什么构成了您应用程序的健康状态。
例如,Marathon 本身有 /ping URL 表示服务的基本可用性。
在 v0.13.0 版本之前的 Web 界面中无法编辑健康检查,请参阅 release notes:
Improved application modal
The application create/edit modal has undergone significant architectural and UX improvements.
It is now possible to specify application labels, accepted resource roles, the user field and
health checks. Additionally, a more fine-grained input validation and error handling has been
implemented.
在较低版本上,您应该使用 Marathon REST API
我执行git clone https://github.com/mesosphere/marathon.git
下载最新的marathon,而且我从marathon doc知道我们可以设置'healthChecks'的属性来监控作业。
但是当我开始马拉松比赛时,我在任何地方都找不到 属性 'healthChecks',
而且我确定我下载的马拉松是最新的。
谁能告诉我如何使用 'healthChecks' ?
这是 'healthChecks'
的马拉松文档你可以在 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
}
],
Health Checks doc 页面提供了有关如何使用它们的详细信息。
请注意,健康检查依赖于应用程序,这意味着您必须在您的应用程序中实施它们并公开它们,因为只有您知道什么构成了您应用程序的健康状态。
例如,Marathon 本身有 /ping URL 表示服务的基本可用性。
在 v0.13.0 版本之前的 Web 界面中无法编辑健康检查,请参阅 release notes:
Improved application modal The application create/edit modal has undergone significant architectural and UX improvements. It is now possible to specify application labels, accepted resource roles, the user field and health checks. Additionally, a more fine-grained input validation and error handling has been implemented.
在较低版本上,您应该使用 Marathon REST API