title: Remote access to namenode is not allowed despite the services are already started.
body: <p>I successfully installed and run Hadoop on a single machine whose ip is 192.168.1.109 (In fact it is actually an Ubuntu instance running on virtual box ) . 
  When typing jps it shows</p>
  
  <p><strong>2473 DataNode</strong></p>
  
  <p><strong>2765 TaskTracker</strong></p>
  
  <p><strong>3373 Jps</strong></p>
  
  <p><strong>2361 NameNode</strong></p>
  
  <p><strong>2588 SecondaryNameNode</strong></p>
  
  <p><strong>2655 JobTracker</strong></p>
  
  <p>This should mean that the hadoop is up and running.
  Running commands like ./hadoop fs -ls is fine and produces the expected result.</p>
  
  <p>But If I try to connect it from my windows box whose ip is 192.168.1.80 by writing
  Java code's HDFS API to connect it as follows:</p>
  
  <p><strong>Configuration conf = new Configuration();</strong></p>
  
  <p><strong>FileSystem hdfs = null;</strong></p>
  
  <p><strong>Path filenamePath = new Path(FILE_NAME);</strong></p>
  
  <p><strong>hdfs = FileSystem.get(conf);</strong> &lt;-- the problem occurred at this line</p>
  
  <p>when I run the code, the error displayed as follows:</p>
  
  <p><strong>11/12/07 20:37:24 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 0 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:26 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 1 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:28 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 2 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:30 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 3 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:32 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 4 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:33 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 5 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:35 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 6 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:37 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 7 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:39 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 8 time(s).</strong></p>
  
  <p><strong>11/12/07 20:37:41 INFO ipc.Client: Retrying connect to server: /192.168.1.109:9000. Already tried 9 time(s).</strong></p>
  
  <p><strong>java.net.ConnectException: Call to /192.168.1.109:9000 failed on  connection exception: java.net.ConnectException: Connection refused: no further information</strong></p>
  
  <p>To make sure if the socket is already opened and waits for the incoming connections on the hadoop serer, I netstat on the ubuntu box
  the result shows as follows:</p>
  
  <p><strong>tcp        0      0 localhost:51201         <em>:</em>                     LISTEN      2765/java</strong><br>
  <strong>tcp        0      0 *:50020                 <em>:</em>                     LISTEN      2473/java</strong><br>
  <strong>tcp        0      0 localhost:9000          <em>:</em>                     LISTEN      2361/java</strong><br>
  <strong>tcp        0      0 localhost:9001          <em>:</em>                     LISTEN      2655/java</strong><br>
  <strong>tcp        0      0 *:mysql                 <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:50090                 <em>:</em>                     LISTEN      2588/java</strong><br>
  <strong>tcp        0      0 *:11211                 <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:40843                 <em>:</em>                     LISTEN      2473/java</strong><br>
  <strong>tcp        0      0 *:58699                 <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:50060                 <em>:</em>                     LISTEN      2765/java</strong><br>
  <strong>tcp        0      0 *:50030                 <em>:</em>                     LISTEN      2655/java</strong><br>
  <strong>tcp        0      0 *:53966                 <em>:</em>                     LISTEN      2655/java</strong><br>
  <strong>tcp        0      0 *:www                   <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:epmd                  <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:55826                 <em>:</em>                     LISTEN      2588/java</strong><br>
  <strong>tcp        0      0 *:ftp                   <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:50070                 <em>:</em>                     LISTEN      2361/java</strong><br>
  <strong>tcp        0      0 *:52822                 <em>:</em>                     LISTEN      2361/java</strong><br>
  <strong>tcp        0      0 *:ssh                   <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:55672                 <em>:</em>                     LISTEN      -</strong><br>
  <strong>tcp        0      0 *:50010                 <em>:</em>                     LISTEN      2473/java</strong><br>
  <strong>tcp        0      0 *:50075                 <em>:</em>                     LISTEN      2473/java</strong>    </p>
  
  <p>I noticed that if the local address column is something like localhost:9000 (starts with localhost: not *:)
  It will not be able to be connected from remote host or even in it own box in some case.
  I tried telnet localhost 9000  it works, I means it can connect to the port but If I use telnet 192.168.1.109 9000
  The errors displays like</p>
  
  <p><strong>$ telnet 192.168.1.109 9000
  Trying 192.168.1.109...
  telnet: Unable to connect to remote host: Connection refused</strong></p>
  
  <p>I have spent almost a week figuring out the issue I am really exhausted now and I hope someone can help me.</p>
  
  <p>Note: I am not sure if namenode by default refuses remote connection. Do I need to change some settings in order for it to allow
  remote connections?</p>