title: How to configure hosts file for Hadoop ecosystem
body: <p>The question may seem pretty obvious, but I have faced it many times, due to bad configuration of hosts file on a hadoop cluster.</p>
  
  <p>Can anyone describe how to setup hosts file and other related network configuration for hadoop and similar environment usage (like cloudera).</p>
  
  <p>Specially when i have to add both the hostname and FQDN</p>
  
  <p><strong>Update</strong> </p>
  
  <p>Here is the host file of one of the machine from host name cdh4hdm have role of hadoop Master </p>
  
  <pre><code> 127.0.0.1       cdh4hdm        localhost
    #127.0.1.1      cdh4hdm 
  
   # The following lines are desirable for IPv6 capable hosts
  
     172.26.43.40    cdh4hdm.imp.co.in            kdc1
     172.26.43.41    cdh4hbm.imp.co.in   
     172.26.43.42    cdh4s1.imp.co.in    
     172.26.43.43    cdh4s2.imp.co.in    
     172.26.43.44    cdh4s3.imp.co.in    
     172.26.43.45    cdh4s4.imp.co.in    
  
     ::1     ip6-localhost ip6-loopback
     fe00::0 ip6-localnet
     ff00::0 ip6-mcastprefix
     ff02::1 ip6-allnodes
     ff02::2 ip6-allrouters 
  </code></pre>
  
  <p>Please see image attached </p>
  
  <p>Here on cluster some nodes are getting FQDN and some are getting hostname. </p>
  
  <p>Also IP of hostname is not proper and showing 127.0.0.1 instead of host IP </p>
  
  <p>Please suggest </p>