Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Mesos Cookbook

You're reading from   Apache Mesos Cookbook Efficiently handle and manage tasks in a distributed environment

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher Packt
ISBN-13 9781785884627
Length 146 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (3):
Arrow left icon
David Blomquist David Blomquist
Author Profile Icon David Blomquist
David Blomquist
Tomasz Janiszewski Tomasz Janiszewski
Author Profile Icon Tomasz Janiszewski
Tomasz Janiszewski
Marco Massenzio Marco Massenzio
Author Profile Icon Marco Massenzio
Marco Massenzio
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Getting Started with Apache Mesos FREE CHAPTER 2. Implementing High Availability with Apache ZooKeeper 3. Running and Maintaining Mesos 4. Understanding the Scheduler API 5. Managing Containers 6. Deploying PaaS with Marathon 7. Job Scheduling with Metronome 8. Continuous Integration with Jenkins

Downloading, building, and installing the Mesos source code

In this recipe, we will download the Mesos source files, build the code, and install the Mesos binaries and libraries.

Getting ready

Follow the previous sections in this chapter to prepare your operating system for a Mesos source installation.

How to do it...

  1. Browse to the following location: http://mesos.apache.org/downloads/.
  2. Download the TAR file for the most recent stable release of Mesos. For example, to download Mesos version 1.0.1:
$ wget http://www.apache.org/dist/mesos/1.0.1/mesos-1.0.1.tar.gz
  1. Extract the contents of the TAR file. For example, to extract the Mesos 1.0.1 TAR file:
$ tar xvzf mesos-1.0.1.tar.gz 
  1. Change the directory to the extracted TAR file directory created in the previous step, for example:
$ cd mesos-1.0.1
  1. Create the build directory:
$ mkdir build
  1. Change directory to the build directory:
$ cd build  
  1. Configure the Mesos build script. You can run ../configure --help to see all the available configuration options. Refer to the There's more... section at the end of this recipe for more configuration tips:
  $ ../configure
  1. Build the Mesos binaries (executing 'make -j <number of cores> V=0 will decrease both the build time and log verbosity on multicore systems). Refer to the There's more... section at the end of this recipe for more build tips:
$ make  
  1. Optional: Run some tests:
$ make check
  1. Optional: Execute the make install command if you would like to install the Mesos binaries and libraries in /usr/local/ and add them to the system path. Mesos can also be installed in other locations or run directly from the build directory. Refer to the There's more... section at the end of this recipe for instructions on installing Mesos to alternative locations, as well as for other installation tips:
$ sudo make install
  1. Optional: For Ubuntu only, create links to the Mesos libraries if you chose the default installation to /usr/local:
$ sudo ldconfig  
  1. At this point, you can start Mesos to do some basic testing. To start the Mesos master and agent daemons, first create the mesos working directory:
$ sudo mkdir /var/lib/mesos  
  1. Change into the Mesos source build directory:
$ cd build  
  1. Now start the Mesos master:
$ sudo ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
  1. And start the Mesos agent (in a separate terminal session):
$ sudo ./bin/mesos-agent.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos
  1. To validate the Mesos installation, open a browser on the Mesos host and point it to http://127.0.0.1:5050. If you wish to validate with a browser remotely, you will need to replace 127.0.0.1 with the real IP of the Mesos host in the previous commands and restart both the master and agent. You will also need to use the real IP of the Mesos host in the browser.
Warning
When using the real IP in the command line, the Mesos master and agent processes will fail to start unless the Mesos host is registered in DNS.

How it works...

Building the Mesos source code will create the binaries needed to run Mesos. Next, you will configure ZooKeeper, which is covered in Chapter 2, Implementing High Availability with Apache ZooKeeper.

There's more...

Refer to the following tips.

Configuration tips

There are a number of options that can be configured in the Mesos build script. For example, if you want to build Mesos with SSL support, you will need to enable the ssl and libevent features by executing ../configure --enable-ssl --enable-libevent prior to executing make. To see a full list of the configure options, execute ../configure --help from the Mesos build directory.

Build tips

If you are building out a Mesos cluster using hosts with the same operating system version, you can configure and build the source code on one server and then copy that source directory to the other servers. You can then skip the ../configure and make commands and just run Mesos from the build directory or execute make install to install it without having to go through the build (make) process on every server.

If you do plan on copying pre-built Mesos software to other servers, make sure all of the servers have the supporting packages required to run Mesos and that the OS is patched to the same version.

Installation tips

The default behavior of make install is to install the Mesos binaries and libraries in the /usr/local path. If you would like to change the installation path, execute ../configure --prefix=/path/to/install/directory during the configure stage prior to the build (make) and install (make install) stages.

If at some point you would like to uninstall the Mesos binaries from the installation path, you can execute make uninstall from the source code build directory. After building and installing the Mesos source code, we recommend archiving the source code directory for future reference.

You have been reading a chapter from
Apache Mesos Cookbook
Published in: Aug 2017
Publisher: Packt
ISBN-13: 9781785884627
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image