This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Hadoop and the fly likes Mapr using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Hadoop
Bookmark "Mapr using java" Watch "Mapr using java" New topic
Author

Mapr using java

bharath phatak
Greenhorn

Joined: Jul 28, 2011
Posts: 7
Hi All,

I am new to Hadoop, Mapr and Pivotal. I have written java code to write into pivotal but facing issue while writing into Mapr.

public class HadoopFileSystemManager {

public void writeFile(String filePath,String data) throws IOException, URISyntaxException {
Path fPath = new Path(filePath);
String url = url = "hdfs://"+ip+":"+"8020";
FileSystem fs = FileSystem.get(new URI(url),new Configuration());
System.out.println(fs.getWorkingDirectory());
FSDataOutputStream writeStream = fs.create(fPath);
writeStream.writeChars(data);
writeStream.close();
}

}


This code works fine with pivoatal but fails with Mapr.

For Mapr i am using port = 7222.
I am getting the following error
"An existing connection was forcibly closed by the remote host"

Please let me know if am using the right port or anything needs to be changed in the code specific to Mapr.

I have stopped the iptables.

Any info is much appreciated.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Mapr using java
 
Similar Threads
displaying loading image on clicking a link or Node
how to access remote files
saving file path from servlet in mysql
how to read files from remote system
problem displaying images from files in Firefox