In this post, we will explore how to quickly and easily spin up our own VM with Vagrant and Apache Ambari. Vagrant is very popular with developers as it lets one mirror the production environment in a VM while staying with all the IDEs and tools in the comfort of the host OS.
If you’re just looking to get started with Hadoop in a VM, then you can simply download the Hortonworks Sandbox.
Prerequisites
Spin up a VM with Vagrant
Create a folder for this VM: mkdir hdp_vm

cp ambari.repo /etc/yum.repos.d
Double check that the repo has been configured correctly:
yum repolist
![
Now we are ready to install the bits from the repo:
yum install ambari-server
![
Now we can configure the bits. I just go with the defaults during the configuration:
ambari-server setup
![
Let’s spin up Ambari:
ambari-server start
![
Setting up the pseudo-cluster with Ambari:
Now you can access Ambari from your host machine at the url http://localhost:8080. The username and password is admin and admin respectively:
![
Name your cluster:
![
Select HDP 2.0:
![
Input the hostname of your VM and click on the Choose File button:
![
Select the private key file you can find in the folder you created at the beginning of this post:
![
Select the default options for the rest of the steps till you get to Customize Services. In this step, configure your preferred credentials especially for the components marked with a white number against the red background:
![
Finish up the wizard.
![
Voila!!! We have our very own Hadoop VM.
Happy Hadooping!
Saptak Sen
If you enjoyed this post, you should check out my book: Starting with Spark.