hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arun C Murthy <ar...@yahoo-inc.com>
Subject Re: Any one can tell me about how to write to HDFS?
Date Fri, 30 Nov 2007 14:57:58 GMT
Ryan,

On Fri, Nov 30, 2007 at 10:48:30PM +0800, Ryan Wang wrote:
>Hi,
>I can communicate with the file system via shell command, and it worked
>corretly.
>But when I try to write program to write file to the file system, it failed.
>

Could you provide more info on the errors, your configuration, hadoop-version etc.?

http://wiki.apache.org/lucene-hadoop/Help

Arun
>public class HadoopDFSFileReadWrite {
>
>
>    public static void main(String[] argv) throws IOException {
>
>        Configuration dfsconf = new Configuration();
>        FileSystem dfs = FileSystem.get(dfsconf);
>
>        Path inFile = new Path(argv[0]);
>        Path outFile = new Path(argv[1]);
>
>        dfs.copyFromLocalFile(inFile, outFile);
>    }
>}
>
>argv[0]=nutch/search/bin/javalibTest.tar.gz argv[1]=ryan/test.tar.gz
>The program write the javalibTest.tar.gz  to the Project's
>Dir/ryan/test.tar.gz
>I also placed the file modified hadoop-site.xml to  the Project 's Path?
>I don't know why? anyone could help me out ?
>
>Thanks
>Ryan

Mime
View raw message