Tutorial - Installing the First Package

Part 2 - Installing the First Package

Important: Mesosphere does not support this tutorial, associated scripts, or commands, which are provided without warranty of any kind. The purpose of this tutorial is to demonstrate capabilities, and may not be suited for use in a production environment. Before using a similar solution in your environment, you must adapt, validate, and test.

Welcome to part 2 of the DC/OS 101 Tutorial.


By now, you should have a running DC/OS cluster and the DC/OS CLI installed and configured. If that isn’t the case, please follow the first part of this tutorial. The next stage of this tutorial uses jq, a command line JSON processor to simplify some of the commands. Follow the instructions here to install JQ for your operating system.


By the end of this session you will have installed your first service - Redis - from the DC/OS Universe repository. Redis is a key-value store, which you will use for persisting data in this tutorial.


Install Redis

  1. Search the Universe repository for redis packages:

     dcos package search redis

This should return two entries (mr-redis and redis). You want the redis package, which installs a single Redis container.

  1. Install the package with this command:

     dcos package install redis
  2. Verify that redis is running. You can use any of the following methods:

  • By looking at the web interface: The Redis task should be displayed in the Service Health tab along with the health status.
  • By looking at all DC/OS tasks with the dcos task command. This command will show us all running DC/OS tasks (such as Mesos tasks).
  • By looking at all Marathon apps: dcos marathon app list. This command will show us all running Marathon apps. Since services are started via Marathon, you should see Redis here as well. Note that the health status (such as 1/1) is also shown here.
  • By looking at the Redis log: dcos task log redis. This command will show us the logs (stdout and stderr) of the redis task. This allows you to check whether the actual startup was successful. You can increase the number of log lines displayed by using the --lines= argument, the default is 10.

Using Redis

We will use Redis by storing a key manually via the redis-cli command * SSH into the node where redis is running:

  dcos node ssh --master-proxy --mesos-id=$(dcos task  redis --json |  jq -r '.[] | .slave_id')

Because Redis is running in a Docker container, you can list all Docker containers using docker ps and get the ContainerID of the container running the redis service.

  1. Start a bash session in the running container, substituting CONTAINER_ID with the ContainerID you got from the previous command:

    sudo docker exec -i -t CONTAINER_ID  /bin/bash
  2. Start the Redis CLI:

  3. Set a key with a value:

    set mykey key1
  4. Check the value is there:

    get mykey


You have just successfully installed your first service from the Universe repository and verified it is running!

Deep Dive

Universe is a package repository made available for DC/OS Clusters. It enables you to easily install services such as Apache Spark or Apache Cassandra in your cluster without having to deal with manual configuration. Universe packages are developed and maintained by many different contributors.

There are currently two categories of packages:

  1. Curated packages that have undergone testing and certification.
  2. Community contributed packages, which may not be as well tested.

You can also add your own repo that includes your custom packages. See the documentation for details.