Step 1: Create includes file in /home/hadoop directory.
Step 2: Update Hdfs-site.xml add the following property
<property>
<name>dfs.hosts</name>
<value>/home/hadoop/includes</value>
<final>true</final>
</property>
Step 3: Update mapred-site.xml
<property>
<name>mapred.hosts</name>
<value>/home/hadoop/includes</value>
<final>true</final>
</property>
Step 4: Run below command to refresh the nodes
hadoop dfsadmin -refreshNodes
Step 5: Run report command to see the list of nodes
hadoop dfsadmin -report