java Apache Mesos 实际上是做什么的?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28094147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does Apache Mesos actually do?
提问by smeeb
I am trying to wrap my head around Apache Mesosand need clarification on a few items.
我正在尝试围绕Apache Mesos 进行思考,并需要对一些项目进行澄清。
My understandingof Mesos is that it is an executable that gets installed on every physical/VM server ("node") in a cluster, and then provides a Java API (somehow) that treats each individual node as a collective pool of computing resources (CPU/RAM/etc.). Hence, to programs coding against the Java API, they only see 1 single set of resources, and don't have to worry about how/where the code is deployed.
我对Mesos 的理解是,它是一个可执行文件,安装在集群中的每个物理/VM 服务器(“节点”)上,然后提供一个 Java API(以某种方式),将每个单独的节点视为计算资源的集合池( CPU/RAM/等)。因此,对于针对 Java API 进行编码的程序,他们只能看到一组资源,而不必担心代码的部署方式/位置。
So for one, I could be fundamentally wrong in my understanding here (in which case, please correct me!). But if I'm on target, then how does the Java API (provided by Mesos) allow Java clients to tap into these resources?!? Can someone give a concrete example of Mesos in action?
因此,一方面,我在这里的理解可能是根本错误的(在这种情况下,请纠正我!)。但是,如果我是目标,那么 Java API(由 Mesos 提供)如何允许 Java 客户端利用这些资源?!?有人可以举一个具体的 Mesos 实例吗?
Update
更新
Take a look at my awful drawing below. If I understand the Mesos architecture correctly, we have a cluster of 3 physical servers (phys01
, phys02
and phys03
). Each of these physicals is running an Ubuntu host (or whatever). Through a hypervisor, say, Xen, we can run 1+ VMs.
看看下面我糟糕的画。如果我正确理解 Mesos 架构,我们有一个由 3 个物理服务器(phys01
、phys02
和phys03
)组成的集群。这些物理设备中的每一个都运行 Ubuntu 主机(或其他)。通过虚拟机管理程序,例如 Xen,我们可以运行 1 个以上的 VM。
I am interested in Docker & CoreOS, so I'll use those in this example, but I'm guessing the same could apply to other non-container setups.
我对 Docker 和 CoreOS 感兴趣,所以我将在这个例子中使用它们,但我猜这同样适用于其他非容器设置。
So on each VM we have CoreOS. Running on each CoreOS instance is a Mesos executable/server. All Mesos nodes in a cluster see everything underneath them as a single pool of resources, and artifacts can be arbitrarily deployed to the Mesos cluster and Mesos will figure out which CoreOS instance to actually deploy them to.
所以在每个虚拟机上我们都有 CoreOS。在每个 CoreOS 实例上运行的是 Mesos 可执行文件/服务器。集群中的所有 Mesos 节点都将它们下面的所有内容视为单个资源池,并且工件可以任意部署到 Mesos 集群,Mesos 将确定将它们实际部署到哪个 CoreOS 实例。
Running on top of Mesos is a "Mesos framework" such as Marathon or Kubernetes. Running inside Kubernetes are various Docker containers (C1
- C4
).
在 Mesos 之上运行的是“Mesos 框架”,例如 Marathon 或 Kubernetes。在 Kubernetes 内部运行的是各种 Docker 容器 ( C1
- C4
)。
Is this understanding of Mesos more or less correct?
这种对 Mesos 的理解或多或少是正确的吗?
采纳答案by vanthome
Your summary is almost right but it does not reflect the essence of what mesos represents. The vision of mesosphere, the Company behind the project, is to create a "Datacenter Operating System" and the mesos is the kernel of it in analogy to the kernel of a normal OS. The API is not limited to Java, you can use C, C++, Java/Scala, or Python. If you have set-up your mesos cluster, as you describe in your question and want to use your resources, you usually do this through a frameworkinstead of running your workload directly on it. This doesn't mean that this is complicated here is a very small example in Scalawhich demonstrates this. Frameworks exist for multiple popular distributed data processing systems like Apache Spark, Apache Cassandra. There are other frameworks such as Chronosa cron on data center level or Marathonwhich allows you to run Docker based applications.
你的总结几乎是正确的,但它没有反映 mesos 所代表的本质。该项目背后的公司 mesosphere 的愿景是创建一个“数据中心操作系统”,而 mesos 是它的内核,类似于普通操作系统的内核。API 不限于 Java,您可以使用 C、C++、Java/Scala 或 Python。如果您已经设置了 mesos 集群,正如您在问题中所描述的那样并且想要使用您的资源,您通常通过一个框架来执行此操作,而不是直接在其上运行您的工作负载。这并不意味着这很复杂,这是Scala 中的一个非常小的示例,它演示了这一点。存在多个流行的分布式数据处理系统的框架,如Apache Spark、Apache Cassandra. 还有其他框架,例如数据中心级别的Chronosa cron 或Marathon,它们允许您运行基于 Docker 的应用程序。
Update:
更新:
Yes, mesos will take care about the placement in the cluster as that's what a kernel does -- scheduling and management of limited resources. The setup you have sketched raises several obvious questions, however.
是的,mesos 会像内核一样关注集群中的位置——调度和管理有限资源。但是,您绘制的设置提出了几个明显的问题。
Layers below mesos: Installing mesos on CoreOSis possible but cumbersome as I think. This is not a typical scenario for running mesos -- usually it is moved to the lowest possible layer (above Ubuntu in your case). So I hope you have good reasons for running CoreOS anda hypervisor.
mesos 下的层:在 CoreOS 上 安装 mesos是可能的,但我认为很麻烦。这不是运行 mesos 的典型场景——通常它被移动到尽可能低的层(在你的情况下高于 Ubuntu)。所以我希望你有充分的理由运行 CoreOS和管理程序。
Layers above mesos: Kubernetes ist available as framework and mesosphere seems to put much effort in it. It is, however, without question that there are partly overlapping in terms of functionality -- especially with regard to scheduling. If you want to schedule basic workloads based on Containers, you might be better off with Marathonor in the future maybe Aurora. So also here I hope you have good reasons for this very arrangement. Sidenote: Kubernetes is similar to Marathon with a broader approach and pretty opinionated.
中间层之上的层:Kubernetes 可用作框架,中间层似乎在其中付出了很多努力。然而,毫无疑问,在功能方面存在部分重叠——尤其是在调度方面。如果您想基于 Containers 安排基本工作负载,那么使用Marathon或将来可能会使用Aurora可能会更好。所以我也希望你们有充分的理由来安排这个安排。旁注:Kubernetes 与 Marathon 类似,具有更广泛的方法并且非常自以为是。