Jean-Luc’s Blog

An IT Blog.

Your First Mesos Command [En]

First setup the basic thing in local, and then run our first mesos command.

Basic setup

If you’re an OS X user, you can install according to the documentation http://mesosphere.com/docs/getting-started/developer/brew-install/ which is very didactic. http://mesosphere.com/docs/guides/ contains a lot of useful information.

So once it’s installed :

  • Zookeeper is installed and started

Starting the services

First, let’s check that Zookeeper is started:

1
jps | grep QuorumPeerMain

if no process is listed, please check your Zookeeper setup.

Start the mesos master:

1
/usr/local/sbin/mesos-master --registry=in_memory --ip=127.0.0.1

Start the mesos slave:

1
sudo /usr/local/sbin/mesos-slave --master=127.0.0.1:5050

Check the services are ok:

Start a simple mesos command

Let’s execute a simple ls command

1
mesos execute --master=127.0.0.1:5050 --name=Command --command="ls"

Where to find logs

Then go to the Mesos console and click on Framework.

The Framework view is displayed: Mesos Framework View

Then click in the Terminated framework link like …5050-9877-0000.

The Framework detail is displayed: Mesos Framework Detail

Then click the sandbox link. The sandbox window is opened: Sandbox window

Click the stdout link, the following log is displayed:

1
2
3
4
5
6
7
8
9
10
11
12
13
Registered executor on 172.16.0.17
Starting task Command
sh -c 'ls'
Forked command at 10500
stderr
stdout
Command exited with status 0 (pid: 10500)
Shutting down
Sending SIGTERM to process tree at pid 10500
Killing the following process trees:
[

]

Important : the mesos console is your best friend, when something is wrong, always try to puzzle out the error logs accessible through the mesos framework view.

Comments