Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

To check the java is installed

$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

To know the location of java runtime


$ which java
/usr/bin/java
To know software installed location
$ readlink -f /usr/bin/java
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
To know the location of SSH
$ which ssh
$ which sshd
To generate the RSA Public Key
$ ssh-keygen -t rsa -P ""

To Authorize the RSA public key

$ cat /home/hduser/.ssh/id_rsa.pub >> /home/hduser/.ssh/authorized_keys

IN GUI MODE:
Copy the hadoop-2.7.0.tar.gz, hadoop core.tar, fscat / fcsat.jar file to Desktop/batchno folder

To know the details about tar


$ tar
$ tar -–help (dash dash help)

Extract the hadoop-2.7.0.tar.gz file


$ tar zxvf hadoop <tab>
$ cd h<tab>

To check correctly installed in our dire


$ vim /etc/profile
{The following content will not be available in exam}
#--insert HADOOP_PREFIX
HADOOP_PREFIX=/home/student/Desktop/rr/hadoop-2.7.0 {change according to our path}

#--in PATH variable just append at the end of the line


PATH=$PATH:$HADOOP_PREFIX/bin

#--Append HADOOP_PREFIX at end of the export statement

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 {Fetch using $JAVA_HOME }


#PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME
export PATH JAVA_HOME HADOOP_PREFIX

To execute the profile file


$ source /etc/profile
If there is an change in terminal it denotes the change has been applied.
To check the profile has updated
$ echo $HADOOP_PREFIX
To check the java profile has been updated
$ echo $JAVA_HOME

Create hadoop_store folder inside Desktop/rr/


$mkdir hadoop_store
$cd hadoop_store
$mkdir hdfs
$cd hdfs
$mkdir namenode
$mkdir datanode

{The location where hadoop-2.7.0 exists}

UPDATE CONFIGURATION FILES

$ cd etc/<hadoop>

$ls -ltr {To display in descending order}


MODIFY THE CONFIGURATION FILES
1. hadoop-env.sh
2. core-site.xml
3. hdfs-site.xml
4. mapred-site.xml (to create)
5. yarn-site.xml

$vim hadoop-env.sh

MODIFY export JAVA_HOME = ${JAVA_HOME}


replace with
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

SAVE AND EXIT

$vim core-site.xml

Add the following within <configuration> tag.


<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>

SAVE AND EXIT

$ vi hdfs-site.xml

Add the following within <configuration> tag.


<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/home/student/Desktop/rr/hadoop_store/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/home/student/Desktop/rr/hadoop_store/hdfs/datanode</value>
</property>
</configuration>

SAVE AND EXIT

$ cp mapred-site.xml.template mapred-site.xml
$ vi mapred-site.xml
Add the following inside <configuration> tag
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>

SAVE AND EXIT

$ vi yarn-site.xml
Add the following inside <configuration> tag
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>

$ hdfs namenode -format


STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = RV-ANDROID16/10.1.2.11
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.6.0-cdh5.7.1.....
......
Y
......

$ hadoop version
student@RV-ANDROID16:~/Desktop/rr/hadoop-2.7.0/etc/hadoop$ hadoop version
Hadoop 2.6.0-cdh5.7.1
Subversion http://github.com/cloudera/hadoop -r ae44a8970a3f0da58d82e0fc65275fff8deabffd
Compiled by jenkins on 2016-06-01T23:27Z
Compiled with protoc 2.5.0
From source with checksum 298b68dc3b308983f04cb37e8416f13
This command was run using /usr/lib/hadoop/hadoop-common-2.6.0-cdh5.7.1.jar
student@RV-ANDROID16:~/Desktop/rr/hadoop-2.7.0/etc/hadoop$

$hadoop
-- check all the options
$ hadoop trace
....

To check hadoop installation


$ jps
15859 jps

// NO NAMENODE LIST SO MOVE TO HADOOP BIN DIRECTORY

$ { move to} Desktop/rr/hadoop-2.7.0/sbin

$ ls
student@RV-ANDROID16:~/Desktop/rr/hadoop-2.7.0/sbin$ ./start-all.sh

{Enter passwords for all files}

finally
$ jps
27168 Jps
27027 NodeManager
25908 DataNode
26101 SecondaryNameNode
26711 ResourceManager
student@RV-ANDROID16:~/Desktop/rr/hadoop-2.7.0/sbin$

$./stop-all.sh
$jps

You might also like