Professional Documents
Culture Documents
$ pwd
# list the content of the home directory
$ ls -ltr
# de-compress the binary install file
$ tar xvzf hadoop-2.7.2.tar.gz
# list the content of the home directory
$ ls -ltr
# generate private-public key pair
$ ssh-keygen -t rsa -P ""
# add the public key to trust store
$ cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
# navigate to the configuration directory
$ cd hadoop-2.7.2/etc/hadoop
#
#
#
#
#
$ nano core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://ubuntu.dhcp.blrl.sap.corp:9000</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
</configuration>
$ nano hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>file:///home/user1/hdfs/namenode</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>file:///home/user1/hdfs/datanode</value>
</property>
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
</configuration>
$ nano yarn-site.xml
<configuration>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>localhost</value>
<value>ubuntu.dhcp.blrl.sap.corp</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.cl
ass</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
</configuration>
$ nano mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>ubuntu.dhcp.brlr.sap.corp:9001</value>
</property>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
# update the hadoop environment to point to correct JDK
$ nano hadoop-env.sh
export JAVA_HOME="/usr/local/java/jdk1.8.0_65"
export PATH=$PATH:$HADOOP_INSTALL/bin:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_LIB_NATIVE=$HADOOP_INSTALL/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib -Djava.net.p
referIPv4Stack=true"
export YARN_OPTS="-Djava.net.preferIPv4Stack=true"
# navigate to hadoop root directory
$ cd /home/user1/hadoop-2.7.2
# Format a new distributed-filesystem (hdfs)
$ bin/hadoop namenode -format
# the above command creates the following HDFS filesystem
$ ls -ltr $HOME/hdfs/namenode/current
# start / stop HDFS with the following command:
$ sbin/start-dfs.sh
$ sbin/stop-dfs.sh
# display all the processes
$ jps
#
$
$
$
Test HDFS:
bin/hadoop
bin/hadoop
bin/hadoop
#
$
$
$
$
$
$