Install DC/OS on Vagrant


This installation method uses Vagrant to create a cluster of virtual machines on your local machine that can be used for demos, development, and testing with DC/OS.

Prerequisites

Your machine should have at least 16GB of RAM.

Note: If you are installing DC/OS on Vagrant, it only used for demos, development, and testing. Not use for production.

A) Download DC/OS Installer

First, it’s necessary to download the DC/OS 1.7.0 Installer. Save this somewhere safe – you’ll need this when setting up DC/OS Vagrant:

$ curl -O https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh

B) Install DC/OS Vagrant

1. Install & Configure Vagrant & VirtualBox

I assume, you have working Vagrant and VirtualBox on your machine. If not then first of all, Install Vagrant and Virtual box on your system.

Installing Virtualbox:

 $ sudo apt-get install virtualbox

Installing Vagrant:

$ sudo apt-get install vagrant

Install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the Linux kernel version changes during the next apt-get upgrade.

$ sudo apt-get install virtualbox-dkms

2. Clone DC/OS Vagrant Repo

Change the directory where you want to run the DC/OS and clone the dcos-vagrant repo and cd into it.

$ git clone https://github.com/dcos/dcos-vagrant
$ cd dcos-vagrant

You can also upgrade the latest version of dcos-vagrant:

  • Change into the repo directory (e.g. cd ~/workspace/dcos-vagrant)
  • Checkout the new desired version (e.g. git checkout v0.6.0)
  • Pull the new code (e.g. git pull)

3. Configure VirtualBox Networking

Configure the host-only vboxnet0 network to use the 192.168.65.0/24 subnet.

Create the vboxnet0 network if it does not exist:

$ VBoxManage list hostonlyifs | grep vboxnet0 -q || VBoxManage hostonlyif create

Set the vboxnet0 subnet:

$ VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.65.1

4. Install Vagrant Host Manager Plugin

The Host Manager Plugin manages the /etc/hosts on the VMs and host to allow access by hostname.

$ vagrant plugin install vagrant-hostmanager

This will update /etc/hosts every time VMs are created or destroyed.

5. Download the DC/OS Installer

As we already downloaded, we need to move dcos_generate_config.sh to the root of the repo (the repo will be mounted into the vagrant machines as /vagrant).

$ cd dcos_generate_config.sh dcos-vagrant

6. Configure the DC/OS Installer

As we have downloaded DC/OS 1.7.0 Installer so we will export etc/config-1.7.yaml to DCOS_CONFIG_PATH env variable.

$ export DCOS_CONFIG_PATH=etc/config-1.7.yaml

The path to the config file is relative to the repo dir, because the repo dir will be mounted as /vagrant within each VM. Alternate configurations may be added to the <repo>/etc/ dir and configured in a similar manner.

7. Configure the DC/OS Machine Types

There is sample VagrantConfig.yaml.example dcos-vagrant repo that we can configure for DC/OS machine type. At this point of time, we not need to do any changes.

cd <repo>
cp VagrantConfig.yaml.example VagrantConfig.yaml
8. Download the VM Base Image

By default, Vagrant will automatically download the latest VM Base Image (virtualbox box) when you run vagrant up <machines>, but since downloading the image takes a while the first time, you may want to trigger the download manually.

$ vagrant box add https://downloads.dcos.io/dcos-vagrant/metadata.json

If you already have the latest version downloaded, the above command will fail.

9. Deploy DC/OS

Specify which machines to deploy in your cluster. Below are a few options to try.

a) Minimal Cluster

A minimal cluster supports launching small Marathon apps. Most other services will fail to install, because they require more than one agent node.

Requires > 4.5GB free memory (using the example VagrantConfig).

$ vagrant up m1 a1 boot

b) Small Cluster

A small cluster supports running tasks on multiple nodes.

Requires > 7.25GB free memory (using the example VagrantConfig).

$ vagrant up m1 a1 a2 p1 boot

c) Medium Cluster

A medium cluster supports the installation of a minimally configured Cassandra.

Requires > 10GB free memory (using the example VagrantConfig).

$ vagrant up m1 a1 a2 a3 a4 p1 boot

d) Large Cluster

Requires > 17GB free memory (using the example VagrantConfig).

A large cluster supports master node fail over, multiple framework installs, and multiple public load balancers.

$ vagrant up m1 m2 m3 a1 a2 a3 a4 a5 a6 p1 p2 p3 boot
10. Access DC/OS from browser

Once the the machines are created and provisioned, DC/OS will be installed. Once complete, the Web Interface will be available at http://m1.dcos/.

11. Additionally you can Authentication DC/OS

If your DC/OS CLI or the web dashboard prompt for username and password then the superuser credentials are by default admin/admin

Advertisements

3 thoughts on “Install DC/OS on Vagrant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s