重启后的 Mesos 任务历史

Mesos task history after restart

我正在使用 Mesos 进行容器编排,并使用 /task 端点从 Mesos 获取任务历史记录。

Mesos 在 7 节点集群中 运行 而 zookeeper 在 3 节点集群中 运行。我希望,Mesos 使用 Zookeeper 来存储任务历史记录。当我们重新启动 Mesos 时,我们有时会丢失历史记录。它存储在内存中吗?我想了解这里发生了什么。

我的问题是,

  1. 它在哪里存储任务历史记录?
  2. 我们如何配置任务历史记录清理策略?
  3. 为什么我们在重新启动 Mesos 时会丢失完整的任务历史记录?

回答您的问题:

  1. Mesos 的任务history/state 是存储在内存中的,而在replicated_log (details here). The default is set to use the replicated_log, to store state completely in memory without the replicated_log you would have to specify this in your Mesos flags seen here in the configuration page as --registry=in_memory
  2. 大多数用户通常使用这三个标志(还有更多,但最常见)--max_completed_frameworks=VALUE--max_completed_tasks_per_framework=VALUE--max_unreachable_tasks_per_framework=VALUE 配置任务历史记录清理,如以前的文档。
  3. 是的,每次重新启动 Mesos Master 时,/tasks 端点的任务历史记录都会丢失。但是,/state 端点仍将包含所有任务状态随时间的变化。

** 已编辑以反映有关 /tasks 端点而非 /state 端点的信息。