...
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 ~
|
...
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>
|
...
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/current/installing-hadoop-using-ambari/content/index.html), but to get up and running quickly with default settings, you can run the following:
Code Block |
---|
wget http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA/ambari.repo (to test latest public release) OR wget http://s3.amazonaws.com/dev.hortonworks.com/AMBARI.dev-1.x/repos/centos6/ambari.repo (to test latest trunk code in development) cp ambari.repo /etc/yum.repos.d yum install ambari-server -y ambari-server setup -s ambari-server start |
...
Once you are at the login page, login with the default username admin and password admin.
On the Install Options page, use the FQDNs of the VMs. For example:
Code Block |
---|
c6401.ambari.apache.org
c6402.ambari.apache.org
c6403.ambari.apache.org
|
Alternatively, you can use a range expression:
Code Block |
---|
c64[01-03].ambari.apache.org
|
...
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]
|
...
Vagrant makes it easy to take snapshots of the entire cluster.
First, install the snapshot plugin:
Code Block |
---|
vagrant plugin install vagrant-vbox-snapshot --plugin-version=0.0.2
|
...