我正在尝试在我的 mesosphere DCOS 集群上设置 mesos 导出器。我指的链接是https://github.com/prometheus/mesos_exporter。我使用的 JSON 文件是:
{
"id": "/mesosexporter",
"instances": 6,
"cpus": 0.1,
"mem": 25,
"constraints": [["hostname", "UNIQUE"]],
"acceptedResourceRoles": ["slave_public","*"],
"container": {
"type": "DOCKER",
"docker": {
"image": "prom/mesos-exporter",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 9105,
"hostPort": 9105,
"protocol": "tcp"
}
]
}
},
"healthChecks": [{
"protocol": "TCP",
"gracePeriodSeconds": 600,
"intervalSeconds": 30,
"portIndex": 0,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 2
}]
}
但是只有暴露给 Prometheus 的仪表是“mesos_exporter_slave_scrape_errors_total”。mesos 导出器向 Promethues 公开的其他仪表是什么。mesos-exporter 的 github 上的自述文件说我们需要提供命令行标志,但是如果我想将 mesos exporter 作为 docker 容器运行,我应该如何指定配置?
编辑 - 仪表“mesos_exporter_slave_scrape_errors_total”给出非零值,表示在抓取期间发生错误。
编辑 - 添加“参数”原语后,我的 JSON 文件如下所示:
{
"id": "/mesosexporter",
"instances": 1,
"cpus": 0.1,
"mem": 25,
"constraints": [["hostname", "UNIQUE"]],
"acceptedResourceRoles": ["slave_public"],
"container": {
"type": "DOCKER",
"docker": {
"image": "prom/mesos-exporter",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 9105,
"hostPort": 9105,
"protocol": "tcp"
}
],
"privileged": true,
"parameters": [
{ "key": "-exporter.discovery", "value": "true" },
{ "key": "-exporter.discovery.master-url",
"value": "http://mymasterDNS.amazonaws.com:5050" }
]
}
},
"healthChecks": [{
"protocol": "TCP",
"gracePeriodSeconds": 600,
"intervalSeconds": 30,
"portIndex": 0,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 2
}]
}
Mesos 版本:0.22.1
马拉松版本:0.8.2-SNAPSHOT
使用此 JSON 后,应用程序仍处于“部署”状态