hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Uma Mahesh <mahesw...@huawei.com>
Subject RE: access HDFS file from outside the Hadoop Cluster
Date Mon, 25 Jul 2011 09:11:33 GMT
Hi ,
  
  If you want to write the files from out side of the cluster, you can put
the hadoop-common*.jar and hadoop-hdfs*.jar into your classpath.

 There will be one class FileSystem.java in that libraries, this class will
have the fileSystem APIs. (For example copyToLocal, copyFromLocal, rename ,
delete..etc)

 using this apis, you can do.

 FileSystem fs=new DistributedFileSystem();
 fs.initialize( <nameNode URI {ex: hdfs//10.18.52.61:9000/} >, <configObj
{new Configuration()}>);
 fs.copyFromLocal(.....);

 This should work for you.
 

Regards,
Uma 

-----Original Message-----
From: Yang Xiaoliang [mailto:yangxiaoliang2006@gmail.com] 
Sent: Monday, July 25, 2011 9:48 AM
To: hdfs-user@hadoop.apache.org
Subject: access HDFS file from outside the Hadoop Cluster

Hi all,

I want to write a file into HDFS from outside the Hadoop cluser.
The hadoop runs on nodeA, nodeB, nodeC, ...
but my program runs on another node on the same local network (but not in
the hadoop cluser), so, how to write a file into the HDFS from this node?

Could anyone help?
Thanks!


Mime
View raw message