Step 1 Build a VM

Building a Single Node VM is a great way to get started using HAWQ. You can use Amazon for this as well but here are the steps to do this all on your local machine. This post will cover how to get your VM created.

You can either download an existing CentOS 6.5 VM or build one from an ISO. I chose to build it from an ISO and use VMWare Fusion.

Download 6.5 Minimal

1. Add VM in VMWare Fusion.
NewVM
NewCustom
NewChooseOS
NewVirtualDisk
NewFinish
NewSaveAs
2. Mount the ISO
Unfortunately, VMWare Fusion will try to start the VM you just created but you haven’t attached mounted the ISO yet.
NoOS

Shutdown the VM.
NoOSShutdown
ChooseDisc
ChooseISO
ConnectISO
Now you can start the VM.

3. Install CentOS
With the DVD ISO mounted, you will immediately go to the installation menu for CentOS when the VM is started. Pick the first option of “Install or Upgrade an existing system”.
CentOSInstall1
Skip the media test.
CentOSInstall2
Pick your language on the next two screens and then pick “Basic Storage Devices”.
CentOSInstall3
“Discard any data”.
CentOSInstall4
I used “hdb” as my hostname.
CentOSInstall5
Pick your timezone.
CentOSInstall6
Set your password. I used “changeme” which is a weak password but just fine for a VM.
CentOSInstall7
Use the default “Replace Existing Linux System(s)”.
CentOSInstall8
Write changes to disk.
CentOSInstall9
Installing…
CentOSInstall10
Reboot.
CentOSInstall11

4. Configure CentOS
Log in as root with the password changeme.

Enable the ethernet adapter.

sed -i 's/ONBOOT=no/ONBOOT=yes/g' /etc/sysconfig/network-scripts/ifcfg-eth0 
dhclient

Get the IP Address and add it to your local /etc/hosts file.

ifconfig | grep "inet addr"

My address is 192.168.175.135 so I added this line to my local hosts file:

192.168.175.135 hdb

Now you can ssh to root@hdb to perform the following commands.

chkconfig iptables off
service iptables stop
echo 0 >/selinux/enforce
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
sed -i '/\t\bkernel\b/ s/$/ transparent_hugepage=never/' /boot/grub/grub.conf
yum update openssl -y
yum install ntp -y
/etc/init.d/ntpd start
yum install httpd -y
/etc/init.d/httpd start
yum install wget -y
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa
ln -s /etc/init.d/httpd /etc/rc3.d/S15httpd
ln -s /etc/init.d/ntpd /etc/rc3.d/S74ntpd

5. Memory and Processors
Shutdown the VM.

shutdown -P now

Now go to the Virtual Machine Settings and then Processors and Memory. I am using 8GB of RAM and 4 cores for my VM.
MemorySettings
I also created a snapshot of my VM at this stage.
VMSnapshot

Now the VM is ready for the next step of installing Ambari, Hadoop, and HAWQ.