【发布时间】:2015-11-04 22:58:21
【问题描述】:
我已按照https://github.com/discordianfish/nginx_exporter 中给出的步骤为 nginx 导出器 设置了一个 docker 容器。
现在我想在 mesosphere 集群上使用 marathon 为 nginx 安装 docker 容器。如何向 docker 容器提供参数“nginx.scrape_uri”。 我已经尝试在此链接https://mesosphere.github.io/marathon/docs/native-docker.html 中使用“特权模式和任意 Docker 选项”中给出的“参数”原语,但是,在 JSON 中添加参数原语会使应用程序停留在“部署”状态。
我使用马拉松为 nginx-exporter 创建应用程序的 JSON 文件是:
{
"id": "/nginx-exporter",
"instances": 1,
"cpus": 0.1,
"mem": 25,
"constraints": [["hostname", "UNIQUE"]],
"acceptedResourceRoles": ["slave_public"],
"container": {
"type": "DOCKER",
"docker": {
"image": "fish/nginx-exporter",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 9113,
"hostPort": 9113,
"protocol": "tcp"
}
],
"parameters": [ {"key": "nginx.scrape_uri", "value": "http://52.76.26.53:8080" }
]
}
},
"healthChecks": [{
"protocol": "TCP",
"gracePeriodSeconds": 600,
"intervalSeconds": 30,
"portIndex": 0,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 2
}]
}
请告诉我将参数“nginx.scrape_uri”添加到 JSON 文件的正确方法。 谢谢。
【问题讨论】:
标签: mesosphere prometheus