AnsweredAssumed Answered

How to remotely connect to MapR FS to access MapR-DB Table from Java Application?

Question asked by seephor on Jun 22, 2016
Latest reply on Jul 12, 2016 by tugdual

Hello!

 

I am super new to all things MapR and Hadoop, so please help me out with this if possible.

 

I have the hadoop sandbox running on a VM on my mac. The VM's network setup is NAT and I have ports 7222 and 2222 forwarded. I can ssh in just fine.

 

I wrote an application that leverages OJAI to create and manipulate JSON MapR-DB tables. The application works perfectly when I run it from within the VM.

 

Now I am trying to run this application outside of the VM and have it remotely connect to the MapR FS and access a MapR-DB JSON table.

 

I have tried to use the MapRDB class and the FileSystem class to connect, but both have lead to no success. This is what I currently have:

 

 

Configuration conf = new Configuration();

  conf.set("fs.default.name", "maprfs://127.0.0.1:7222");

  conf.set("fs.maprfs.impl", "com.mapr.fs.MapRFileSystem");

  BufferedWriter br = null;

  Path pt = new Path("maprfs://127.0.0.1:7222/home/mapr/test");

  FileSystem fs = null;

  try {

  fs =  MapRFileSystem.get(URI.create("maprfs://127.0.0.1:7222/user/mapr"),conf);

  br = new BufferedWriter(new OutputStreamWriter(fs.create(pt, true)));

  } catch (Exception e) {

  e.printStackTrace();

  }

 

I expect this to create a file named test using the user "mapr" on my local VM. Instead, I keep getting these errors:

 

2016-06-22 14:42:17,9648 ERROR Cidcache fs/client/fileclient/cc/cidcache.cc:1653 Thread: 123145304514560 ClusterInfoRequest RPC error Operation timed out(60) for CLDB someIP:7222

2016-06-22 14:43:34,2155 ERROR Client fs/client/fileclient/cc/client.cc:5826 Thread: 123145304514560 rpc err Operation timed out(60) 28.21 to someIP:5660, fid 2049.16.2, upd 0

 

what is the correct way to remotely connect to the MapR-FS via a Java application so I can access a MapR-DB table?

Outcomes