此内容没有您所选择的语言版本。

Chapter 4. Create Hadoop Image


This release supports the following plug-ins:

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.

Note

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:

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
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.