How to test Greenplum Community Edition 4.2.1 on VirtualBox

August 10, 2012

As usual Greenplum Community Edition 4.2.1 is available as a VMWare virtual machine based on CentOS with all the fancy tools and the documentation already installed. This allows you to easily try it.
This article is an updated guide about running the provided image on VirtualBox.

Assuming you already have VirtualBox installed (if not you can install it from your package manager or download it from http://www.virtualbox.org/), you can download the VMWare image for Greenplum from http://www.greenplum.com/community/downloads/database-ce/.

As first step extract the Greenplum Virtual Machine in a convenient place. For this tutorial I’ve chosen the $HOME/gp directory.

First create a new virtual machine, by clicking “New” and then following the wizard for the creation procedure.
Give a name to the machine and choose “Linux” as operating system and Red Hat 64-bit as version.

When you are asked about memory allocation give it at least 3000MB if you can. If you cannot afford it, you can lower this value a bit, but you should give it at least 1024MB.

In the next screen simply deselect the “Start-up Disk” check-box and choose Next.

A warning about the lack of a primary hard disk will be displayed, but the disk will be added manually in the next step. So press the
“Continue” button.

A summary will be displayed and the “Create” button will complete the creation of the virtual machine.

Now open the settings area of your freshly baked virtual machine. Select the “Storage” section and add a new hard disk to the IDE controller, by clicking on the “+” sign.
Click on “Choose disk” button and select the VMWare hard disk image. Select the first file of the series, named “CentOS 64-bit-cl1.vmdk”.

At this point the virtual machine is ready to be started, so start it.

I’ve also prepared a little script that automates the process up to here. To use it, put it in the same directory of the gpdb421ee.tar.gz and start it.
[bash]
#!/bin/bash

set -e
DEST=$PWD
TAR=$PWD/gpdb421ee.tar.gz
VM=”Greenplum 4.2.1.0″
MEM=3000

cd “${DEST}”
tar zxf “${TAR}”

VMX=$(ls “${DEST}”/*/*.vmx)
VMX_DIR=”${VMX%/*}”
DISK_FILE=$(sed -n ‘
/scsi0:0.fileName/{
s/^.*=[[:space:]]*//;
s/”\(.*\)”/\1/;
p;
}’ “${VMX}”)
DISK=”${VMX_DIR}/${DISK_FILE}”

VBoxManage createvm –name “${VM}” –ostype RedHat_64 \
–basefolder “${DEST}” \
–register
VBoxManage modifyvm “${VM}” –memory “$MEM”
VBoxManage storagectl “${VM}” –name “IDE Controller” –add ide
VBoxManage storageattach “${VM}” –storagectl “IDE Controller” \
–port 0 –device 0 –type hdd –medium “${DISK}”
VBoxManage storageattach “${VM}” –storagectl “IDE Controller” \
–port 1 –device 0 –type dvddrive –medium emptydrive
VBoxManage startvm “${VM}”
[/bash]

At first, it won’t work, as X will search the VWMare graphic card. So you will see a blue error screen asking you if you want to display the Xorg log file to diagnose the problem. Select “No”. When asked if you want to reconfigure the X server select “No”.

At the shell login prompt type root as user and password as password.

As the first thing to do we need to remove VMWare from this VM.

If you don’t feel comfortable with the US keyboard layout you can change it with the command “loadkeys COUNTRYCODE” (for example, to load the Italian keyboard layout type “loadkeys it”).

Now it’s time to uninstall the VMWare drivers by running vmware-uninstall-tools.pl utility.

[bash]
vmware-uninstall-tools.pl
[/bash]

We also have to install the VirtualBox drivers, but they will not compile with the current kernel, so we have to update it.

[bash]
yum install kernel kernel-devel
[/bash]

Before reboot with the new kernel I suggest to make another little adjustment.
To greatly shorten the boot time of this VM you have to add ‘localhost.localdomain’ as first value of line referring to 127.0.0.1 in /etc/hosts.
You can do it with your favorite editor or running the the following command:

[bash]
sed -i ‘s/localhost /localhost.localdomain localhost /’ /etc/hosts
[/bash]

Now reboot.

Login once again as root (you might have to answer to the same questions and setup your keyboard again), so that you can now install VirtualBox drivers.
From the VirtualBox window, select “Install Guest Additions” under the “Devices” menu. Then, go back to your root shell and type:

[bash]
mount /dev/cdrom /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
eject /dev/cdrom
[/bash]

Reboot again.

Your system is now ready for testing and getting started with Greenplum.

We remind you that this article is solely intended for evaluation purposes of the community edition of Greenplum and its main features.
If you want to evaluate performance of Greenplum, we recommend you to install Greenplum on physical servers with good disk I/O performance and CPU power.

I finally would like to thank Giulio Calacoci who wrote a similar guide last year – on which this guide is based.

Share this

More Blogs