Follow these steps to set the map and reduce slots:
Step 1: Update mapred-site.xml of namenode and add following property
<property>
<name>mapred.tasktracker.map.tasks.maximum</name>
<value >4</value>
<final>true</final>
</property>
<property>
<name>mapred.tasktracker.reduce.tasks.maximum</name>
<value >2</value>
<final>true</final>
</property>
Step 2: Update mapred-site.xml of datanode1 and add following property
<property>
<name>mapred.tasktracker.map.tasks.maximum</name>
<value >4</value>
<final>true</final>
</property>
<property>
<name>mapred.tasktracker.reduce.tasks.maximum</name>
<value >2</value>
<final>true</final>
</property>
Step 3: Update mapred-site.xml of datanode1 and add following property
<property>
<name>mapred.tasktracker.map.tasks.maximum</name>
<value >4</value>
<final>true</final>
</property>
<property>
<name>mapred.tasktracker.reduce.tasks.maximum</name>
<value >2</value>
<final>true</final>
</property>
Hope this helps!