Appendix A. Installing Apache Hadoop
It’s easy to install Hadoop on a single machine to try it out. (For installation on a cluster, refer to Chapter 10.)
In this appendix, we cover how to install Hadoop Common, HDFS, MapReduce, and YARN using a binary tarball release from the Apache Software Foundation. Instructions for installing the other projects covered in this book are included at the start of the relevant chapters.
Tip
Another option is to use a virtual machine (such as Cloudera’s QuickStart VM) that comes with all the Hadoop services preinstalled and configured.
The instructions that follow are suitable for Unix-based systems, including Mac OS X (which is not a production platform, but is fine for development).
Prerequisites
Make sure you have a suitable version of Java installed. You can check the Hadoop wiki to find which version you need. The following command confirms that Java was installed correctly:
%
java -version
java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Installation
Start by deciding which user you’d like to run Hadoop as. For trying out Hadoop or developing Hadoop programs, you can run Hadoop on a single machine using your own user account.
Download a stable release, which is packaged as a gzipped tar file, from the Apache Hadoop releases page, and unpack it somewhere on your filesystem:
%
tar xzf hadoop-
x.y.z
.tar.gz
Before you can run Hadoop, you need to tell it where Java is ...
Get Hadoop: The Definitive Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.