Over a million developers have joined DZone.

Minimal Mesosphere DC/OS v1.9 (With Only 1 Node)

DZone's Guide to

Minimal Mesosphere DC/OS v1.9 (With Only 1 Node)

This lightweight deploy of Mesosphere DC/OS is perfect for tooling around with containers and microservices while keeping the overhead low.

· Cloud Zone ·
Free Resource

Discover a centralized approach to monitor your virtual infrastructure, on-premise IT environment, and cloud infrastructure – all on a single platform.

Mesosphere DC/OS is built on top of Apache Mesos, which is a leading open-source framework for distributed applications. The key design differentiation is its two-level scheduler, which enables it to handle complex workloads like Big Data analytics, grid computing, etc.

The official recommendation for a lab-install is Vagrant, which may not be available in most of the big enterprise environments (for obvious reasons).

In this article, we’ll go over the procedure for setting up a tiny DC/OS cluster using a single VM and a demonstration of basic orchestration capabilities using the Marathon framework.


  • One VM only! (for a resource constrained lab or laptop)
  • CentOS 7.3 Minimal + SELINUX disabled + Firewall disabled + IPv6 disabled
  • Docker (docker-ce 17.06.0.ce)


Host Role VM Size
mesos-single bootstrap + master + slave + dcos-cli 2 CPU, 6GB RAM, 60GB HDD


NOTE: Set proxy-related environment variables if needed.

# only if proxy is needed
export http_proxy=""
export https_proxy=""
# get yum repo for docker-ce
curl -sfo /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo

# install docker-ce and other required packages
yum install -y epel-release docker-ce tar xz unzip curl ipset chrony
groupadd nogroup
# clean yum cache (optional)
yum clean all

# only if proxy is needed
# proxy needed - start
mkdir -p /etc/systemd/system/docker.service.d

cat > /etc/systemd/system/docker.service.d/override.conf << '__EOF__'

systemctl daemon-reload
# proxy needed - end

# enable and start docker
systemctl enable docker
systemctl start docker

# add to host file if DNS doesn't resolve the hostname
tee -a /etc/hosts << '__EOF__' mesos-single

To Be Run for Bootstrap

Generate bootstrap:

# create setup directory, download the install binary
mkdir /opt/dcos-setup && cd /opt/dcos-setup && curl -O https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh

# create config directory 
mkdir -p genconf

# create ip-detect script; change 'ens192' if needed
cat > genconf/ip-detect << '__EOF__'
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show ens192 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
chmod 755 genconf/ip-detect

### VERY IMPORTANT: validate that the following ip-detect is working
### if not then follow https://dcos.io/docs/1.9/administration/installing/custom/advanced/
###   to get a working script, must work consistently on this node

# configuration yaml
cat > genconf/config.yaml << '__EOF__'
bootstrap_url: http://mesos-single:8081       
cluster_name: dcos
exhibitor_storage_backend: static
master_discovery: static
telemetry_enabled: 'false'
# only if proxy is needed
use_proxy: 'true'
- localhost
- '*.sudhaker.com'

# generate bootstarp
bash dcos_generate_config.sh

Launch bootstrap:

# serve the bootstrap code-base using tiny nginx (alpine based)
docker pull nginx:alpine
docker run -d --restart=unless-stopped -p 8081:80 -v /opt/dcos-setup/genconf/serve:/usr/share/nginx/html:ro --name=dcos-bootstrap-nginx nginx:alpine

To Be Run for {master}

mkdir -p /tmp/dcos && cd /tmp/dcos && curl -O --noproxy '*' http://mesos-single:8081/dcos_install.sh && bash dcos_install.sh master && cd -

The installation's progress can be seen at the exhibitor URL, i.e.

Install dcos-cli (while we are waiting for the master to come up).

mkdir -p ~/bin && cd ~/bin && curl -sfO https://downloads.dcos.io/binaries/cli/linux/x86-64/0.4.17/dcos && chmod 755 ~/bin/dcos && cd -

dcos config set core.dcos_url
dcos auth login

To Be Run for {slave}

NOTE: This is the tweak for running a slave on the master node (not supported officially, may break in future releases).

export opt_mesos=$(ls -1d /opt/mesosphere/packages/mesos--*)
ln -s $opt_mesos/dcos.target.wants_slave/dcos-mesos-slave.service /etc/systemd/system
ln -s $opt_mesos/dcos.target.wants_slave/dcos-mesos-slave.service /etc/systemd/system/dcos.target.wants
systemctl start dcos-mesos-slave


Browse to (when ready, usually takes 5-to-10 minutes):

DC/OS v1.9 UI

Install the Tiny marathon-lb (0.1 CPU, 128mb RAM)

IMPORTANT: The dcos package-based install won’t allow our proposed tiny configuration, so we’ll use Marathon!

Export the Marathon JSON:

# allows to run on slave and skip port 80+443 binding
cat > marathon-lb-internal.json << '__EOF__'
{ "marathon-lb":{ "name": "marathon-lb-internal", "instances": 1, "haproxy-group": "internal", "role": "", "bind-http-https": false} }
# export the marathon configuration (for tweaking)
dcos package describe --app --render marathon-lb --options=marathon-lb-internal.json > marathon-lb.json

Edit the JSON. Use sed or manually edit it. Set cpu to 0.1 and mem to 128 (more than enough for a demo setup):

sed -i 's/"cpus": 2/"cpus": 0.1/' marathon-lb.json
sed -i 's/ "mem": 1024/ "mem": 128/' marathon-lb.json

Let marathon deploy this app:

dcos marathon app add marathon-lb.json

Install the Demo App (dockercloud/hello-world)

Our demo app for this setup is dockercloud/hello-world

cat > dockercloud-hello-world.json << '__EOF__'
    "id": "dockercloud-hello-world",
    "container": {
        "type": "DOCKER",
        "docker": {
            "image": "dockercloud/hello-world",
            "network": "BRIDGE",
            "portMappings": [
                { "hostPort": 0, "containerPort": 80, "servicePort":10000 }
    "instances": 2,
    "cpus": 0.1,
    "mem": 128,
    "healthChecks": [{
        "protocol": "HTTP",
        "path": "/",
        "portIndex": 0,
        "timeoutSeconds": 10,
        "gracePeriodSeconds": 10,
        "intervalSeconds": 2,
        "maxConsecutiveFailures": 10

# deploy the demo app
dcos marathon app add dockercloud-hello-world.json

Browse to => or run the following command:

for i in $(seq 1 5); do curl -sf | grep -oP "My hostname is [0-9,a-z]+"; done


My hostname is 705bc9fdf535
My hostname is d74cf174fff0
My hostname is 705bc9fdf535
My hostname is d74cf174fff0
My hostname is 705bc9fdf535


The single node DC/OS setup has a lower (roughly 3GB) resource/memory overhead and can be great for learning and trying out simple container/microservice workloads. It is possible to run additional non-distributed frameworks (like Jenkins) if adequate RAM is available.

Have fun!

Learn how to auto-discover your containers and monitor their performance, capture Docker host and container metrics to allocate host resources, and provision containers.

mesosphere ,dcos ,cloud ,microservices ,tutorial

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}