Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting Started With Apache Mesos

DZone's Guide to

Getting Started With Apache Mesos

Learn how to install Apache Mesos and monitor it by downloading the Mesos TAR file, running Mesos, and starting the slave.

· Big Data Zone ·
Free Resource

Hortonworks Sandbox for HDP and HDF is your chance to get started on learning, developing, testing and trying out new features. Each download comes preconfigured with interactive tutorials, sample data and developments from the Apache community.

In our earlier article, Introduction to Apache Mesos, we talked about the basic idea of Mesos, how it works, and its basic terminology. We have discussed the theoretical concepts to get ourselves familiar with Mesos, and now, we will install Mesos and see how we can monitor it using UI.

Step 1: Download the Mesos TAR File

Download the Mesos 1.4.0 release from here and untar it using the following command on your terminal, and then go to the directory containing our extracted Mesos.

tar -zxf mesos-1.4.0.tar.gz 

Use the following instructions to install the required packages and other Mesos dependencies.

Update the packages:

$ sudo apt-get update 

Install a few utility tools:

 $ sudo apt-get install -y tar wget git 

Install the latest OpenJDK:

$ sudo apt-get install -y openjdk-8-jdk 

Install other Mesos dependencies:

$ sudo apt-get -y install build-essential python-dev python-six python-virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev zlib1g-dev

After downloading Mesos and installing the required packages and dependencies, the next step is to build Mesos.

Change the working directory:

$ cd mesos 

Configure and build:

$ mkdir build
$ cd build
$ ../configure
$ make

Run the test suite:

$ make check 

Install (optional):

$ make install 

It will take a little time to build Mesos. After building, Mesos is ready to use now.

Step 2: Run Mesos

To run Mesos, first, start the Mesos Master.

Change into the build directory:

$ cd build 

Start Mesos Master (ensure work directory exists and has proper permissions):

$ ./bin/mesos-master.sh –ip=127.0.0.1 –work_dir=/var/lib/mesos 

Step 3: Start the Slave

After starting the master, start the slave.

Start slave:

./bin/mesos-slave.sh –master=127.0.0.1:5050 –work_dir=/tmp/mesos

If facing permissions issues:

./bin/mesos-slave.sh –master=127.0.0.1:5050 –work_dir=/tmp/mesos –no-systemd_enable_support

Mesos is running now. To monitor it, visit the Mesos Webpage:

$ localhost:5050

Screenshot from 2017-10-08 11-15-04

Just for testing purposes, we have run C++ and the Java framework.

$ cd build

Run C++ framework (exits after successfully running some tasks):

$ ./src/test-framework –master=127.0.0.1:5050

Run Java framework (exits after successfully running some tasks):

$ ./src/examples/java/test-framework 127.0.0.1:5050

We can see them in the completed framework.

Screenshot from 2017-10-08 11-19-33

We are done with the basic installation of Mesos. I hope you liked this article and want to know more about the usage of Mesos, which we will explore more in future blogs.

Please feel free to leave suggestions or comments!

References

Hortonworks Community Connection (HCC) is an online collaboration destination for developers, DevOps, customers and partners to get answers to questions, collaborate on technical articles and share code examples from GitHub.  Join the discussion.

Topics:
apache mesos ,big data ,tutorial ,monitoring

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}