Once you have Apache Hadoop Installation completes and able to run HDFS commands, the next step is to do Hadoop Yarn Configuration on Cluster. This post explains how to setup Yarn master on the Hadoop cluster and run a map-reduce example.
Before you proceed with this document, please make sure you have Apache Hadoop Installation and the Hadoop cluster is up and running. if you do not have a setup, please follow the below link to set up your cluster and come back to this page.
Apache Hadoop Multi Node Cluster Setup on Ubuntu
By default Yarn comes with Hadoop distribution hence there is no need of additional installation, just you need to configure to use Yarn and some memory/core settings.
1. Configure yarn-site.xml
On yarn-site.xml file, configure default node manager memory, yarn scheduler minimum, and maximum memory configurations.
Copy yarn-site.xml and mapred-site.xml files to all 3 data nodes (I have 3 data nodes)
Below is an example to copy to datanode1 using the SCP command. repeat this setup for all your data nodes.
Note that SecondaryNameNode & NameNode were started with start-hdfs.sh file. With start-yarn.sh command it started ResourceManager on namenode and NodeManager on data nodes.
Now on any datanode run jps command and confirm NadeManager is running.
To stop YARN, run the following command on Namenode.
stop-yarn.sh
6. Yarn UI
Start your Yarn in case if you have stopped it. Now open your favorite browser and enter http://192.168.1.100:8088/cluster (replace 92.168.1.10 with your namenode ip)
7. Run MapReduce Example.
yarn jar ~/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.1.jar wordcount "books/*" output
8. Check Job Status on Yarn UI.
You should see an entry with application ID similar to “application_1547102810368_0001” and the status “FINISHED” state.
9. Yarn logs
To look at the yarn logs, get your job application ID from Yarn UI and run below command.
SparkByExamples.com is a Big Data and Spark examples community page, all examples are simple and easy to understand and well tested in our development environment Read more ..