title: Configuring JAVA project to use hadoop on different (virtual) machine
body: <p>I have a maven project in Intellij Idea locally, and I want to set it up to use Hadoop that I installed on virtual machine. Any suggestions on that? </p>
  
  <p>I have Windows 8.1 locally and Ubuntu 12.0.4 on virtual machine. I have already installed Hadoop there and its working. </p>
  
  <p>EDIT:
  Hadoop setup on VM:
  core-site.xml</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;property&gt;
    &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
    &lt;value&gt;/app/hadoop/tmp&lt;/value&gt;
    &lt;description&gt;A base for other temporary directories.&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;fs.default.name&lt;/name&gt;
    &lt;value&gt;hdfs://localhost:54310&lt;/value&gt;
    &lt;description&gt;The name of the default file system.  A URI whose
    scheme and authority determine the FileSystem implementation.  The
    uri's scheme determines the config property (fs.SCHEME.impl) naming
    the FileSystem implementation class.  The uri's authority is used to
    determine the host, port, etc. for a filesystem.&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>and mapred-site.xml</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;property&gt;
    &lt;name&gt;mapred.job.tracker&lt;/name&gt;
    &lt;value&gt;localhost:54311&lt;/value&gt;
    &lt;description&gt;The host and port that the MapReduce job tracker runs
    at.  If "local", then jobs are run in-process as a single map
    and reduce task.
    &lt;/description&gt;
  &lt;/property&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>and hdfs-site.xml</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;property&gt;
    &lt;name&gt;dfs.replication&lt;/name&gt;
    &lt;value&gt;1&lt;/value&gt;
    &lt;description&gt;Default block replication.
    The actual number of replications can be specified when the file is created.
    The default is used if replication is not specified in create time.
    &lt;/description&gt;
  &lt;/property&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Network on my VM (vmware player) is NAT, and ip address is 192.168.35.128.</p>
  
  <p>Then, I have a simple java project in Intellij Idea (dint think this is important but anyway...), and here is my configuration: </p>
  
  <pre><code>String hdfsUrl = "hdfs://192.168.36.128:54310";
  FileSystem hdfs;
  final Configuration config = new Configuration();
  config.set(FS_DEFAULT_NAME, hdfsUrl);
   try {
              hdfs = FileSystem.get(config);
              if (hdfs != null) {
                  hdfsAvailable = true;
              } else {
                  throw new IOException("Unable to get hdfs, is NULL");
              }
          } catch (IOException e) {
              logger.warn(e.toString());
          }
  </code></pre>
  
  <p>and when I start it, I got the following error: </p>
  
  <blockquote>
    <p>java.io.IOException: No FileSystem for scheme: hdfs</p>
  </blockquote>
  
  <p>so obviously I'm missing something. My OS is windows 8, and on VM is Ubuntu. </p>
  
  <p>IMPORTANT EDIT No.2:</p>
  
  <blockquote>
    <p>telnet 192.168.36.128 54310</p>
  </blockquote>
  
  <p>was successfull, but stil nothing from app... </p>