title: Ambari can't start namenode with a connection exception
body: <p>I have been strapped in this for a few days,I tried a lot of methods on the Internet but it didn't work,so I register on stackoverflow and write my first question.
  My environment is HDP2.4 and Ubuntu14.04 LTS</p>
  
  <p>the log information is like this:</p>
  
  <pre><code>safemode: Call From master/9.119.131.105 to master:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
  2016-04-21 15:59:57,796 - Retrying after 10 seconds. Reason: Execution of '/usr/hdp/current/hadoop-hdfs-namenode/bin/hdfs dfsadmin -fs hdfs://master:8020 -safemode get | grep 'Safe mode is OFF'' returned 1. safemode: Call From master/9.119.131.105 to master:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
  </code></pre>
  
  <p>(1).At first I tried to avoid the safemode,but it isn't the key of this issue.</p>
  
  <p>(2).Then I started to work on the 8020 port of master,master is the namenode of my cluster and I am sure that the hosts file is correct:</p>
  
  <pre><code>9.119.131.105 master
  </code></pre>
  
  <p>(3).ssh function is good,the four nodes in the cluster can load each other without passcodes</p>
  
  <p>(4).I'm sure the fire wall is off</p>
  
  <pre><code># /etc/init.d/iptables stop
  
  # ufw status
  Status: inactive
  </code></pre>
  
  <p>(5).I also tried to open the 8020 port manually:</p>
  
  <pre><code># iptables -A INPUT -p tcp --dport 8020 -j ACCEPT
  </code></pre>
  
  <p>it still didn't work.....</p>
  
  <p>(6).I tried :</p>
  
  <pre><code># telnet master 8020
  </code></pre>
  
  <p>but:</p>
  
  <pre><code>telnet:Unable to connect to remote host: Connect refused
  </code></pre>
  
  <p>(7).I find that not only the 8020 port can't work,but also 50070 can't work</p>
  
  <p>(8).I'm sure the parameters in the configure files is 8020:</p>
  
  <pre><code>fs.defaultFS
  hdfs://master:8020
  
  dfs.namenode.rpc-address
  master:8020
  </code></pre>
  
  <p>I'm expecting somebody can help me,I will be very appreciate about thant.</p>
  
  <p>Thank you!</p>