As of now vanilla plugin works with images with pre-installed Apache Hadoop. To simplify task of building such images we use Disk Image Builder.
Disk Image Builder is built of elements. An element is a particular set of code that alters how the image is built, or runs within the chroot to prepare the image.
Elements for building vanilla images are stored in Savanna extra repository
In this document you will find instruction on how to build Ubuntu and Fedora images with Apache Hadoop 1.1.2.
Clone repositories
1.1 Clone the repository “https://github.com/stackforge/diskimage-builder” locally.
git clone https://github.com/stackforge/diskimage-builder
We’ve tested it with commit: 7e0fe78cf227b0cca8e40d20c884c385bbb2b3c5.
1.2 Clone the repository “https://github.com/stackforge/savanna-extra” locally.
git clone https://github.com/stackforge/savanna-extra git checkout 0.21.3 You will need Oracle JDK 7 downloaded.
The latest version is available at Oracle Java page
Move the downloaded JDK to elements/hadoop/install.d/ for an Ubuntu image or to elements/hadoop_fedora/post-install.d/ for a Fedora and use its filename as JAVA_FILE parameter.
Install prerequisites
- Disk Image Builder requires some libs to be installed.
- curl
- kpartx
- qemu
You may install them using your favorite package manager (ex. apt-get or yum)
sudo apt-get install curl kpartx qemu
Add ~/diskimage-builder/bin/ directory to your path. For example:
PATH=$PATH:/home/$USER/diskimage-builder/bin/.
ELEMENTS_PATH=/home/$USER/diskimage-builder/elements/ to your .bashrc. Then source it.
Copy file img-build-sudoers from ~/disk-image-builder/sudoers.d/ to your /etc/sudoers.d/:
sudo cp ~/disk-image-builder/sudoers.d/img-build-sudoers /etc/sudoers.d/
sudo chown root:root /etc/sudoers.d/img-build-sudoers
sudo chmod 440 /etc/sudoers.d/img-build-sudoers
Move elements directory to disk-image-builder/elements/
mv <path_to_savanna_extra>/savanna-extra/elements/* <path_to_disk_image_builder>/diskimage-builder/elements/
Call the following command to create cloud image with Apache Hadoop:
Ubuntu cloud image
DIB_HADOOP_VERSION=1.1.2 JAVA_FILE=jdk-7u25-linux-x64.tar.gz \
disk-image-create base vm hadoop ubuntu swift_hadoop -o hadoop_1_1_2
Fedora cloud image
DIB_HADOOP_VERSION=1.1.2 JAVA_FILE=jdk-7u25-linux-x64.tar.gz \
DIB_IMAGE_SIZE=10 disk-image-create base vm fedora hadoop_fedora \
swift_hadoop -o fedora_hadoop_1_1_2
In this command: