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.
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