Chapter 4. Create Hadoop Image
This release supports the following plug-ins:
Cloudera (CDH)
- version 5.7.x (default is 5.7.0)
- version 5.9.x (default is 5.9.0)
- version 5.11.x (default is 5.11.0)
- version 5.13.x (default is 5.13.0)
Hortonworks Data Platform
- MapR 5.2
To create a Hadoop image based on any of these plug-ins, you need to first download a Red Hat Enterprise Linux 7 image. You can get one from the following link (requires a Red Hat subscription):
https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.5/x86_64/product-software
Before preparing the image, configure your system to use your Red Hat subscription details so your system can download the necessary tools for creating a Hadoop image. To do so, enter the following commands from a terminal (as root):
# export REG_USER=USERNAME # export REG_PASSWORD=PASSWORD # export REG_POOL_ID=POOLID
Where:
- USERNAME and PASSWORD are your Red Hat subscription credentials.
- POOLID is your Red Hat subscription’s Pool ID. To determine your subscription’s Pool ID, enter following command:
# subscription-manager list --available
This command will display important details about your subscription, including the Pool ID value. The Pool ID should include the Red Hat OpenStack Platform channels.
For more information about manually configuring your Red Hat subscription, see Using and Configuring Red Hat Subscription Manager.
Install the openstack-sahara-image-pack package on the system:
# dnf install openstack-sahara-image-pack -y
Configure the Red Hat Enterprise Linux 7 image to use the Red Hat subscription as well. The image should be registered to the following channel:
- rhel-7-server-rpms
- rhel-7-server-optional-rpms
To do so, run the following command:
# dnf install libguestfs-tools -y
The following commands should be executed as non-root user.
$ virt-customize -a IMAGE \ --sm-register \ --sm-credentials USERNAME:password:_PASSWORD_ \ --sm-attach pool:_POOLID_ \ --run-command 'subscription-manager repos --disable=* --enable rhel-7-server-rpms --enable rhel-7-server-optional-rpms'
Where:
- IMAGE is the name of the Red Hat Enterprise Linux 7 image.
- USERNAME and PASSWORD are your Red Hat subscription credentials.
- POOLID is a Red Hat subscription’s Pool ID. This pool only needs to contain the basic Red Hat Enterprise Linux channels.
To start the customization process, run the following command from the same directory as your Red Hat Enterprise Linux image:
$ sahara-image-pack --image IMAGE PLUGIN VERSION
Replace PLUGIN with the plug-in that the Hadoop image should use.
The following values can be used for PLUGIN and VERSION:
cdh (for Cloudera)
- Specify 5.7.0 (for version 5.7.x), 5.9.0 (for version 5.9.x) or 5.11.0 (for version 5.11.x) as version number. , or 5.13.0 (for version 5.13.x) as version number.
ambari (Hortonworks Data Platform)
mapr (MapR)
- Specify 5.2.0 (MapR 5.2) as version number.
The openstack-sahara-image-pack command will modify the specified base image by adding the software required by the plug-in.
Finalize the image by removing the subscription and fixing the SELinux contexts. Run the following command:
$ virt-customize -a IMAGE --sm-unregister --selinux-relabel