目录

Mac安装Mesos

概述

最近在组内在自研调度系统,测试机是不那么好申请的,所以想在本地(Mac)上跑一个测试服务,发现了一篇英文资料,遂翻译之。

It’s often difficult to get a local environment set up on your Mac, especially if you are working with a distributed system like Mesos. You want a simple way to get all of the essential files onto your computer, placed in the right directories, and ready to begin work. Enter Homebrew, which makes setup easy.

在本地的 Mac 环境配置环境如 Mesos 这样的分布式系统往往是比较麻烦的,你当然可以通过官网的介绍下载已经编译好的安装包或者 git clone 源码自行编译,但是如果你想更容易更快的完成整个过程,Homebrew 是你最佳的选择。

Once you have Homebrew installed, you can install Mesos on your laptop with these two commands: brew update brew install mesos You will need to wait while the most current, stable version of Mesos is downloaded, compiled, and installed on your machine. This could take upwards of 20 minutes (largely because brew compiles Mesos locally), but Homebrew will let you know when it’s finished by displaying a beer emoji in your terminal and a message like the following: /usr/local/Cellar/mesos/0.19.0: 83 files, 24M, built in 17.4 minutes

(省略安装 Homebrew 的方法)如果你的 Mac 已经有 Homebrew,那么可以简单地通过两个命令来安装 Mesos:

1
2
brew update
brew install mesos

以下是译者安装完的日志显示:

译者提示:利用 Homebrew 安装软件一般是会安装到版本较新的 release version,但是不保证是最新的

1
2
3
4
5
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).

Warning: mesos 1.3.0 is already installed

Now that you have Mesos installed on your laptop, it’s easy to start your Mesos cluster. To see Mesos in action, spin up an in-memory master with the following command: /usr/local/sbin/mesos-master --registry=in_memory --ip=127.0.0.1 A Mesos cluster needs at least one Mesos Master to coordinate and dispatch tasks onto Mesos Slaves. When experimenting on your laptop, a single master is all you need. Full production clusters, such as those you might run in a public cloud or in a private datacenter, will usually run Mesos in High Availability Mode. A highly-available Mesos cluster (designed for fault-tolerance with no single point of failure) will often have three or more masters running. Once your Mesos Master has started, you can visit its management console: http://localhost:5050 Since a Mesos Master needs slaves onto which it will dispatch jobs, you might also want to run some of those. Mesos Slaves can be started by running the following command for each slave you wish to launch: sudo /usr/local/sbin/mesos-slave --master=127.0.0.1:5050

启动 Mesos 的方法很简单,通过以下命令 /usr/local/sbin/mesos-master --registry=in_memory --ip=127.0.0.1 就可以了。Mesos 集群至少需要一个 Master 来协调和分发任务给 Slave。作为一个测试,一个单节点的 Master 就可以了,当然实际生产环境中肯定是会使用高可用的模式。

Mesos 提供 UI 可以查看任务情况,可以访问 http://localhost:5050。至此就在 Mac 部署了一个测试的 Mesos 集群,接下来就可以玩一下别的了。

参考资料

  1. Mac开发环境安装Mesos
警告
本文最后更新于 2017年2月1日,文中内容可能已过时,请谨慎参考。