Database Reference
In-Depth Information
Copy the
core-site.xml
,
hdfs-site.xml
, and
mapred-site.xml
files from
node1.hcluster
to
node2.hcluster
,
node3.hcluster
,
and
node4.hcluster
in
/etc/hadoop/conf/
.
16. Execute the following command from
hduser
on each node to start HDFS:
$ for x in 'cd /etc/init.d ; ls hadoop-hdfs-*' ; do
sudo service $x start ; done
The preceding command will start the namenode daemon on
node1.hcluster
and the datanode daemon on
node2.hcluster
,
node3.hcluster
, and
node4.hcluster
.
17. Execute the following command from
hduser
on
node1.hcluster
:
$ sudo -u hdfs hdfs dfs -mkdir /tmp
$ sudo -u hdfs hdfs dfs -chmod -R 1777 /tmp
$ sudo -u hdfs hdfs dfs -mkdir -p /var/lib/
hadoop-hdfs/cache/mapred/mapred/staging
$ sudo -u hdfs hdfs dfs -chmod 1777 /var/lib/
hadoop-hdfs/cache/mapred/mapred/staging
$ sudo -u hdfs hadoop fs -chown -R mapred /var/lib/
hadoop-hdfs/cache/mapred
$ sudo -u hdfs hadoop fs -mkdir /tmp/mapred/system
18. Execute the following command from
hduser
on
node1.hcluster
to start
the jobtracker daemon:
$ sudo service hadoop-0.20-mapreduce-jobtracker start
19. Execute the following command from
hduser
on
node2.hcluster
,
node3.hcluster
, and
node4.hcluster
to start the tasktracker daemon:
$ sudo service hadoop-0.20-mapreduce-tasktracker start
Your four-node Hadoop cluster should now be up and running. You can test the cluster by
visiting the URLs for the namenode UI and the jobtracker UI using a browser. The URL
for the namenode UI is
http://node1.hcluster:50070
. The URL for the job-
tracker UI is
http://node1.hcluster:50030
.