Hadoop RedHat Linux 7 - Setting Up
-
Relocate Apache Hadoop Directory
Get SuperUser Privileges:Copysudo su
If Got “User is Not in Sudoers file” then see: How to Enable sudo
Then Switch the contents with:Copymv /tmp/hadoop* /usr/local/
Make an hadoop symlink directory:
Copyln -s /usr/local/hadoop* /usr/local/hadoop
-
Make Hadoop Needed Directories:
First, Make the Logs Dir:
Copymkdir /usr/local/hadoop/logs
Giving Writing Permissions:
Copychmod 777 /usr/local/hadoop/logs
Next Make the Cache Dir:
Copymkdir /usr/local/hadoop/cache
Same Writing Permissions as for Logs:
Copychmod 777 /usr/local/hadoop/cache
And then also the Temporary Dir:
Copymkdir /usr/local/hadoop/tmp
Set the root as Owner:
Copysudo chown -R root:root /usr/local/hadoop*
-
How to Install Required Java JDK 8+ on Red Hat Linux
Here Install Oracle JDK 8+ for Red Hat LinuxLink to Download and Install Oracle JDK 8+ on Red Hat Linux Distro -
Set JAVA_HOME in Hadoop Env File
Make the Conf directory:Copymkdir /usr/local/hadoop/conf
Make an Env file:
Copynano /usr/local/hadoop/conf/hadoop-env.sh
Append:
Copyexport JAVA_HOME=/usr/lib/jvm/[oracleJdkVersion]
Change [oracleJdkVersion] with the current Version:
Ctrl+x to Save & Exit from nano Editor :) -
Hadoop Configuration for Pseudo-Distributed mode
Copynano /usr/local/hadoop/conf/core-site.xml
Append:
Copy<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hadoop.tmp.dir</name> <value>/usr/local/hadoop/tmp</value> </property> <property> <name>fs.default.name</name> <value>hdfs://localhost:8020</value> </property> </configuration>
Next:
Copynano /usr/local/hadoop/conf/hdfs-site.xml
Append:
Copy<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <!-- specify this so that running 'hdfs namenode -format' formats the right dir --> <name>dfs.name.dir</name> <value>/usr/local/hadoop/cache/hadoop/dfs/name</value> </property> </configuration>
Last:
Copynano /usr/local/hadoop/conf/mapred-site.xml
Append:
Copy<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>mapred.job.tracker</name> <value>localhost:8021</value> </property> </configuration>
-
SetUp Local Path & Environment
Exit from SuperUser to the normal User:Copyexit
Change to the Home directory:
Copycd
Edit the bash Config file:
Copynano .bashrc
Inserts:
CopyHADOOP_HOME=/usr/local/hadoop export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin export JAVA_HOME=/usr/lib/jvm/<oracleJdkVersion>
Then Load the New Setup:
Copysource $HOME/.bashrc
-
SetUp Needed Local SSH Connection
Copysudo systemctl start ssh
Generate SSH Keys to Access:
Copyssh-keygen -b 2048 -t rsa
Copyecho "$(cat ~/.ssh/id_rsa.pub)" > ~/.ssh/authorized_keys
Testing Connection:
Copyssh 127.0.0.1
-
Formatting HDFS
Copyhdfs namenode -format
-
Starting Up Hadoop Database
Copystart-all.sh
Eclipse Hadoop Integration with Free Plugin.
Contents