Initially single node cluster configuration should be done on two separate machines
Add the following lines to the /etc/hosts/ file
192.168.0.1 master (IP address of the master node)
192.168.0.2 slave (IP address of the slave node)
Connect master and slave machine
$ssh-copy-id -i $HOME/.ssh/id_rsa.pub hduser@slave
Connect from master to master
$ssh master
Connect from master to slave
$ssh slave
1. $ vi masters
master
2. $vi slaves
master
slave
192.168.0.1 master (IP address of the master node)
192.168.0.2 slave (IP address of the slave node)
These files are located in following directory
$ cd /usr/local/hadoop-1.2.1/conf
1.Core-site.xml<configuration><property><name>fs.default.name</name><value>hdfs://master:54310</value><description>The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation. The uri's scheme determines the config property (fs.SCHEME.impl) naming the FileSystem implementation class. </description></li>
</ul>
</property>
</configuration>
2.Mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>master:54311</value>
<description>The host and port that the MapReduce job tracker runs at. If "local", then jobs are run in-process as a single map and reduce task. </description>
</property>
</configuration>
3.hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>2</value>
<description>Default block replication. The actual number of replications can be specified when the file is created. The default is used if replication is not specified in create time. </description>
</property>
</configuration>
Execute the below command from Hadoop directory
$hadoop namenode -format
$start-all.sh
$jps
6146 JobTracker
6400 TaskTracker
6541 Jps
5806 DataNode
6057 SecondaryNameNode
5474 NameNode
$jps
15183 DataNode
15897 TaskTracker
16284 Jps
$stop-all.sh
stopping namenode
slave: Ubuntu 12.04
slave: stopping datanode
master: stopping datanode
master: stopping secondarynamenode