Installation of Hadoop on your Centos 6/RHEL box is now a lot simpler since rpm versions have been made available but you nonetheless need to have installed the JDK prior to doing so.
Change the JAVA_HOME path to /usr/java/default and you can install Hadoop via yum from Epel repo.
$ sudo yum -y install hadoop
If you have any problems with yum you can also use the Apache mirror service, download your preference and install it with
$ sudo rpm -Uvh <rpm_package_name>
Once installed as a package, set it up in two steps.
First set up configuration and start Hadoop processes
$ sudo /usr/sbin/hadoop-setup-single-node.sh
You will be asked a series of questions to which you should answer yes and you should get output similar to below.
Welcome to Hadoop single node setup wizard
Would you like to use default single node configuration? (y/n) y
Would you like to format name node? (y/n) y
Would you like to setup default directory structure? (y/n) y
Would you like to start up Hadoop? (y/n) y
Would you like to start up Hadoop on reboot? (y/n) y
Review your choices:
Setup single node configuration : y
Format namenode : y
Setup default file system structure: y
Start up Hadoop : y
Start up Hadoop on reboot : y
Proceed with setup? (y/n) y
and lots more besides, after which the setup will be complete and Hadoop should be started.
Now create a user account on the HDFS
$ sudo /usr/sbin/hadoop-create-user.sh -u $USER
So setting up a single node Hadoop cluster is now much easier.
Labels: Centos 6, Hadoop Single Node Server, RHEL