Tuesday, July 14, 2015

Hadoop : Configuring the Pseudo-distributed mode

Before we go for configuration just goto the conf direcotry of your Hadoop distribution and have look at the files. In the conf directory you will find the following files : -

  • core-site.xml
  • hdfs-site.xml
  • mapred-site.xml
So we need to edit all the fiels one-by-one to make it work in pseudo-distributed mode
core-site.xml : - Just modify the content of core-site.xml similar to below code
<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!-- Put site-specific property overrides in this file. --><configuration><property><name>fs.default.name</name><value>hdfs://localhost:9000</value></property>
<property><name>hadoop.tmp.dir</name><value>/var/lib/hadoop</value></property>
</configuration> 



Attributes which are being used in the core-site.xml
fs.default.name : - It contains the location of Namenode
dfs.name.dir : – It contains the information about the metadata (will see it later)
hadoop.data.dir : -  It is used to create the HDFS data directory (will see it later)
 
hdfs-site.xml : - Just modify the content of hdfs-site.xml similar to below code
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
dfs.replicaton : - How many time hdfs block should be replicated
mapred-site.xml : - It holds information about the job trackers
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
After all the configuration which you have done in the previous steps, there one last step to format the HDFS filesystem before we start it. Please use the following command to format the format the HDFS filesystem : -
1
$ hadoop namenode -format

 

0 comments:

Post a Comment