在 mesos-slave 上保留了多少资源

how much resource reserved on a mesos-slave

mesos-slave 是如何计算其可用资源的。在 web-ui 中,mesos-master 显示 slave 上有 2.9G 可用内存,但我 运行 "free -m":

free -m
             total       used       free     shared    buffers     cached
Mem:          3953       2391       1562          0       1158        771
-/+ buffers/cache:        461       3491
Swap:         4095         43       4052

并且未给出 --resource 参数。 我想知道mesos调度器是如何计算可用资源的。

可以看到计算slave提供的可用资源的函数here, in particular, the memory part is lines 98 to 114

如果机器有超过 2GB 的 RAM Mesos 将提供 total - Gigabytes(1)。在您的情况下,机器有 ~4GB,这就是为什么您在 Web UI 中看到 ~3GB。