title: Access hdfs from outside the cluster
body: <p>I have a hadoop cluster on aws and I am trying to access it from outside the cluster through a hadoop client. I can successfully <code>hdfs dfs -ls</code> and see all contents but when I try to <code>put</code> or <code>get</code> a file I get this error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at org.apache.hadoop.fs.FsShell.displayError(FsShell.java:304)
      at org.apache.hadoop.fs.FsShell.run(FsShell.java:289)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
      at org.apache.hadoop.fs.FsShell.main(FsShell.java:340)
  </code></pre>
  
  <p>I have hadoop 2.6.0 installed in both my cluster and my local machine. I have copied the conf files of the cluster to the local machine and have these options in hdfs-site.xml (along with some other options).</p>
  
  <pre><code>&lt;property&gt;
      &lt;name&gt;dfs.client.use.datanode.hostname&lt;/name&gt;
      &lt;value&gt;true&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;dfs.permissions.enable&lt;/name&gt;
      &lt;value&gt;false&lt;/value&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>My core-site.xml contains a single property in both the cluster and the client:</p>
  
  <pre><code>&lt;property&gt;
    &lt;name&gt;fs.defaultFS&lt;/name&gt;
    &lt;value&gt;hdfs://public-dns:9000&lt;/value&gt;
    &lt;description&gt;NameNode URI&lt;/description&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>I found similar questions but wasn't able to find a solution to this.</p>