Versions Compared

Key

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

...

After you have installed VirtualBox and Vagrant on your computer, check out the “ambari-vagrant” repo on github: $

Code Block

git clone https://github.com/u39kun/ambari-vagrant.git

...


Edit your /etc/hosts on your computer so that you will be able to resolve hostnames for the VMs:

Code Block

...


sudo cat ambari-vagrant/append-to-etc-hosts.txt >> /etc/hosts

Copy the private key to your home directory (or some place convenient for you) so that it’s easily accessible for uploading via Ambari Web:

Code Block

...


vagrant

The above command shows the command usage and also creates the private key $

Code Block

cp ~/.vagrant.d/insecure_private_key ~

Starting VMs

First, change directory to ambari-vagrant: $

Code Block

cd ambari-vagrant

You will see subdirectories for different OS’s. “cd” into the OS that you want to test. "centos6.4" is recommended as this is quicker to launch than other OS's.$
Now you can start VMs with the following command:

Code Block

./up.sh <# of VMs to launch>

Wiki Markup
For example, *./up.sh 3* starts 3 VMs.  3 seems to be a good number with 16GB of RAM
.
You can specify up to 10 (if your computer can handle it!)
VMs will have the FQDN <os-code>01-10
 without taxing the system too much.
You can specify up to 10 (if your computer can handle it!)
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.

Testing Ambari

...

Log into the VM:

Code Block

vagrant ssh c6401

Note that this logs you in as user "vagrant". Once you are logged in, you can run: $

Code Block

sudo su -

to make yourself root. Ambari offers many installation options (see http://incubator.apache.org/ambari/1.2.4/installing-hadoop-using-ambari/content/index.html), but to get up and running quickly with default settings, you can run the following:

Code Block
#rpm yum install 
# -Uvh http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA/ambari-1.x-1.el6.noarch.rpm
yum install ambari-server -y
# ambari-server setup -s
# ambari-server start

Once Ambari Server is started, hit *http://c6401.ambari.apache.org:8080*Image Modified (URL depends on the OS being tested) from your browser on your local computer.
Note that Ambari Server can take some time to fully come up and ready to accept connections. Keep hitting the URL until you get the login page.

...

Follow the onscreen instructions to install your cluster.

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 destroy -f
Destroys all VMs launched from the current directory (deletes them from disk as well)
You can optionally specify a specific VM to destroy

$ vagrant suspend
Suspends (snapshot) all VMs launched from the current directory so that you can resume them later
You can optionally specify a specific VM to suspend

$ vagrant resume
Resumes all suspended VMs launched from the current directory
You can optionally specify a specific VM to resume

$ vagrant ssh host
Starts a SSH session to the host. For example: vagrant ssh c6401

$ vagrant status
Shows which VMs are running, suspended, 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.