Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Quick Start Guide - Installing a cluster with Ambari (with local VMs)

This document shows how to quickly set up a cluster using Ambari on your local machine using virtual machines.
This utilizes VirtualBox and Vagrant so you will need to install both.
Note that the steps were tested on MacOS 10.8.4 / 10.8.5.

Setup

Install VirtualBox from: https://www.virtualbox.org/wiki/Downloads
Install Vagrant from: http://downloads.vagrantup.com

...

The above command shows the command usage and also creates a private key as ~/.vagrant.d/insecure_private_key.  This key will be used in the following steps.

Starting VMs

First, change directory to ambari-vagrant:

...

For example, up.sh 3 starts 3 VMs. 3 seems to be a good number with 16GB of RAM without taxing the system too much.
With the default Vagrantfile, you can specify up to 10 (if your computer can handle it; you can even add more).
VMs will have the FQDN <os-code>[01-10].ambari.apache.org, where <os-code> is c59 (CentOS 5.9), c64 (CentOS 6.4), etc.
E.g., c5901.ambari.apache.org, c6401.ambari.apache.org, etc.
VMs will have the IP address 192.168.<os-subnet>.1[01-10], where <os-subnet> is 59 for CentOS 5.9, 64 for CentOS 6.4, etc.
E.g., 192.168.59.101, 192.168.64.101, etc.
Note that up.sh 3 command is equivalent to doing something like: vagrant up c640{1..3}

Testing Ambari

If it is your first time running a vagrant command, run:

...

When done testing, run vagrant destroy -f to purge the VMs.

Basic VM Operations

vagrant up <vm name>
Starts a specific VM. up.sh is a wrapper for this call.
Note: if you don’t specify the <vm name> parameter, it will try to start 10 VMs
You can run this if you want to start more VMs after you already called up.sh
For example: vagrant up c6406

...

vagrant status
Shows which VMs are running, suspended, etc.

Modifying RAM for the VMs

Each VM is allocated 2GB of RAM. These can be changed by editing Vagrantfile. To change the RAM allocation, modify the following line:

Code Block
vb.customize ["modifyvm", :id, "--memory", 2048] 

Taking Snapshots

Vagrant makes it easy to take snapshots of the entire cluster.
First, install the snapshot plugin:

...

Tip: After starting the VMs but before you do anything on the VMs, run "vagrant snapshot take init".  This way, you can go back to the initial state of the VMs by running "vagrant snapshot go init"; this only takes seconds (much faster than starting the VMs up from scratch by using up.sh or "vagrant up").  Another advantage of this is that you can always go back to the initial state without destroying other named snapshots that you created.

Misc

All VMs launched will have a directory called /vagrant inside the VM. This maps to the ambari-vagrant/<os> directory on your local computer. You can use this shared directory mapping to push files, etc.

If you want to test OS’s other than what’s currently in the ambari-vagrant repo, please see http://www.vagrantbox.es/ for all the readily available OS images you can test. Note that Ambari currently works on RHEL 5/6, CentOS 5/6, Oracle Linux 5/6, SUSE 11, and SLES 11. Ubuntu support is work in progress.

Pre-Configured Development Environment

Simply edit Vagrantfile to launch a VM with all the tools necessary to build Ambari from source.

...

To build from source, follow the instructions in Ambari Development.

Frontend Development

You can use this set up to develop and test out Ambari Web frontend code against a real Ambari Server on a multi-node environment.

...