1 Getting Started with Apache Mesos In this article by David Blomquist author of the book Apache Mesos Cookbook, we will In this chapter, we will provide an overview of the Mesos architecture and recipes for installing Mesos on Linux and Mac. The following are the recipes coverbeed covering in this chapter following topics:
Introduction
Apache Mesos is a cluster management software that can distribute the combined resources of many individual servers to applications through frameworks. Mesos is an open source software that is free to download and use in accordance with the Apache License 2.0. This book article will provide the reader with recipes for deploying and developing Apache Mesos and the Mesos frameworks.
Mesos can run on Linux, Mac, and Windows. However, we recommend running Mesos on Linux for production deployments and on Mac and Windows for development purposes only. Mesos can be installed from TAR files, Git, source code, or from packages downloaded from repositories. We have chosen to cover only a few installation methods on select operating system versions in this bookarticle. The reasons for covering these specific operating systems and installation methods are as follows:
Mesosphere, founded by one of the original developers of Mesos, is a company that provides free open source packages as well as commercial support for Mesos. Mesosphere packages are well maintained and provide an easy way to install and run Mesos. You can run a production Mesos cluster using these packages if you do not require any customization of the build or install process. However, installing from source will allow you to customize the build and install process and enable and disable features. If you want a completely open source and customizable production cluster, we recommend you to install Mesos from source on Ubuntu 16.04 or Ubuntu 14.04. If you want a development environment on a Mac, building from source on OS X is the only way to go. The installation methods that we cover will all provide you with a good base for building out a Mesos development or production environment.
We will guide you through the installations in the following sections, but first, you will need to plan for your Mesos deployment. For a Mesos development environment, you only need one host or node. The node can be a physical computer, a virtual machine, or a cloud instance. For a production cluster, we recommend at least three master nodes and as many slave nodes as you will need to support your application frameworks. You can think of the slave nodes as a pool of CPU, RAM, and storage that can be increased by simply adding more slave nodes. Mesos makes it very easy to add slave nodes to an existing cluster as your application requirements increase. At this point, you should know whether you will be building a Mesos development environment or a production cluster and you should have an idea of how many master and slave nodes you will need. The next sections will provide recipes for installing Mesos in the environment of your choice
Installing Mesos on Ubuntu 16.04 from Packages
In this recipe, we will be installing Mesos .deb packages from the Mesosphere repositories using apt.
Getting ready
You must be running a 64-bit version of the Ubuntu 16.04 operating system and it should be patched to the most current patch level using apt-get prior to installing the Mesos packages.
How to do it…
$ DISTRO=$(lsb_release -is | tr '‘[:upper:]'’ '‘[:lower:]'’) $ CODENAME=$(lsb_release -cs) $ echo "“deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main"” | sudo tee /etc/apt/sources.list.d/mesosphere.list
$ sudo apt-get update
$ sudo apt-get -y install mesos
$ sudo service mesos-master start $ sudo service mesos-slave start
How it works…
The Mesosphere packages provide the software required to run Mesos.. Next, you will configure ZooKeeper, which is covered in Chapter 2. See also If you prefer to build and install Mesos on Ubuntu from source code, we will cover that in an upcoming section in this chapter.
Installing Mesos on Ubuntu 14.04 from Packages
In this recipe, we will be installing Mesos .deb packages from the Mesosphere repositories using apt.
Getting ready
You must be running a 64-bit version of the Ubuntu 14.04 operating system and it should be patched to the most current patch level using apt-get prior to installing the Mesos packages.
How to do it……
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
$ DISTRO=$(lsb_release -is | tr '‘[:upper:]'’ '‘[:lower:]'’) $ CODENAME=$(lsb_release -cs) $ echo "“deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main"” | sudo tee /etc/apt/sources.list.d/mesosphere.list
$ sudo apt-get update
$ sudo service mesos-master start $ sudo service mesos-slave start
How it works…
The Mesosphere packages provide the software required to run Mesos. Next, you will configure ZooKeeper, which is covered in Chapter 2., See also If you prefer to build and install Mesos on Ubuntu from source code, we will cover that in an upcoming section in this chapter.
Installing Mesos on CentOS 7 and RHEL 7 from Packages
In this recipe, we will be installing Mesos .rpm packages from the Mesosphere repositories using yum.
Getting ready
Your CentOS 7 or RHEL 7 operating system should be patched to the most current patch level using yum prior to installing the Mesosphere packages.
How to do it…
$ sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
$ sudo yum -y install mesos mesosphere-zookeeper
$ sudo service mesos-master start $ sudo service mesos-slave start
How it works…
The Mesosphere packages provide the software required to run Mesos. Next, you will configure ZooKeeper, which is covered in Chapter 2.
See also
If you prefer to build and install Mesos from source code on RHEL 7 or CentOS 7, you can find installation instructions for CentOS 7 on the mesos.apache.org website. We do not cover installing Mesos source code on RHEL7 or CentOS 7 in this book article due to dependencies that require the installation of packages from multiple third-party repositories.
Summary
In this article we have learned how to install Mesos on Ubuntu 16.04 from packages, how to install Mesos on Ubuntu 14.04 from packages and how to installing Mesos on CentOS 7 and RHEL 7 from packages.
Further resources on this subject:
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…