Two properties (that is, yarn.nodemanager.aux-services and yarn.nodemanager.aux-services.mapreduce.shuffle.class) need to be set to the etc/hadoop/yarn-site.xml file. Just copy the following lines of codes:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
</configuration>