哪个http端点将帮助我找到当前资源利用率的所有活动框架?我们需要这些信息是因为我们想要动态缩放Mesos簇,我们的算法需要关于每个活动框架正在使用什么资源的信息。
n8ghc7c11#
我认为关注框架并不是你真正想要的。你要找的可能是mesos slave利用率,这可以通过调用请求
http://{mesos-master}:5050/master/state-summary
在json答案中,您将发现 slaves 包含从属对象数组的属性:
slaves
{ "hostname": "192.168.0.3", "cluster": "mesos-hw-cluster", "slaves": [{ "id": "bd9c29d7-8530-4c5b-8c50-5d2f60dffbf6-S2", "pid": "slave(1)@192.168.0.1:5051", "hostname": "192.168.0.1", "registered_time": 1456826950.99075, "resources": { "cpus": 12.0, "disk": 1840852.0, "mem": 63304.0, "ports": "[31000-32000]" }, "used_resources": { "cpus": 5.75, "disk": 0.0, "mem": 14376.0, "ports": "[31000-31000, 31109-31109, 31267-31267, 31699-31699, 31717-31717, 31907-31907, 31979-31980]" }, "offered_resources": { "cpus": 0.0, "disk": 0.0, "mem": 0.0 }, "reserved_resources": {}, "unreserved_resources": { "cpus": 12.0, "disk": 1840852.0, "mem": 63304.0, "ports": "[31000-32000]" }, "attributes": {}, "active": true, "version": "0.27.1", "TASK_STAGING": 0, "TASK_STARTING": 0, "TASK_RUNNING": 7, "TASK_FINISHED": 18, "TASK_KILLED": 27, "TASK_FAILED": 3, "TASK_LOST": 0, "TASK_ERROR": 0, "framework_ids": ["bd9c29d7-8530-4c5b-8c50-5d2f60dffbf6-0000", "bd9c29d7-8530-4c5b-8c50-5d2f60dffbf6-0002"] }, ...}
{
"hostname": "192.168.0.3",
"cluster": "mesos-hw-cluster",
"slaves": [{
"id": "bd9c29d7-8530-4c5b-8c50-5d2f60dffbf6-S2",
"pid": "slave(1)@192.168.0.1:5051",
"hostname": "192.168.0.1",
"registered_time": 1456826950.99075,
"resources": {
"cpus": 12.0,
"disk": 1840852.0,
"mem": 63304.0,
"ports": "[31000-32000]"
},
"used_resources": {
"cpus": 5.75,
"disk": 0.0,
"mem": 14376.0,
"ports": "[31000-31000, 31109-31109, 31267-31267, 31699-31699, 31717-31717, 31907-31907, 31979-31980]"
"offered_resources": {
"cpus": 0.0,
"mem": 0.0
"reserved_resources": {},
"unreserved_resources": {
"attributes": {},
"active": true,
"version": "0.27.1",
"TASK_STAGING": 0,
"TASK_STARTING": 0,
"TASK_RUNNING": 7,
"TASK_FINISHED": 18,
"TASK_KILLED": 27,
"TASK_FAILED": 3,
"TASK_LOST": 0,
"TASK_ERROR": 0,
"framework_ids": ["bd9c29d7-8530-4c5b-8c50-5d2f60dffbf6-0000", "bd9c29d7-8530-4c5b-8c50-5d2f60dffbf6-0002"]
...
}
您可以迭代所有从属对象,并通过汇总 resources 然后减去 used_resources .看见http://mesos.apache.org/documentation/latest/endpoints/master/state-summary/http://mesos.apache.org/documentation/latest/endpoints/
resources
used_resources
1条答案
按热度按时间n8ghc7c11#
我认为关注框架并不是你真正想要的。你要找的可能是mesos slave利用率,这可以通过调用请求
在json答案中,您将发现
slaves
包含从属对象数组的属性:您可以迭代所有从属对象,并通过汇总
resources
然后减去used_resources
.看见
http://mesos.apache.org/documentation/latest/endpoints/master/state-summary/
http://mesos.apache.org/documentation/latest/endpoints/