首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

HDFS上载文件报错

2012-10-31 
HDFS下载文件报错!public static void main(String[] args) throws Exception{System.setProperty(javax.

HDFS下载文件报错!

public static void main(String[] args) throws Exception    {        System.setProperty("javax.xml.parsers.DocumentBuilderFactory",            "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");        // 初始化HDFS文件系统;        Configuration cfg = new Configuration();        cfg.set("hadoop.job.ugi", "hadoop,supergroup"); // "hadoop,supergroup"        cfg.set("fs.default.name", "hdfs://master:9000"); // "hdfs://master:9000"        cfg.set("mapred.job.tracker", "hdfs://master:9001"); // "hdfs://master:9001"        cfg.set("dfs.http.address", "master:50070"); // "master:50070"                FileSystem fs = FileSystem.get(cfg);        String localPath = "d:\\temp";        String hdfsPath = "/tmp/query_ret/7/attempt_201007151545_0024_r_000000_0";        fs.copyToLocalFile(new Path(hdfsPath), new Path(localPath));        System.out.print(123);    }

?

?

Running: INSERT OVERWRITE DIRECTORY '/tmp/query_ret/4' select userid from chatagret where  1 = 1  order by userid[2010-07-15 20:36:43,578][ERROR][ULThread_0][ULTJob.java86]java.io.IOException: Cannot run program "chmod": CreateProcess error=2, ?????????at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)at org.apache.hadoop.util.Shell.runCommand(Shell.java:149)at org.apache.hadoop.util.Shell.run(Shell.java:134)at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:286)at org.apache.hadoop.util.Shell.execCommand(Shell.java:354)at org.apache.hadoop.util.Shell.execCommand(Shell.java:337)at org.apache.hadoop.fs.RawLocalFileSystem.execCommand(RawLocalFileSystem.java:481)at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:473)at org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:280)at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:372)at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:479)at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:460)at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:367)at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:208)at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:199)at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:142)at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1211)at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1192)at com.huawei.wad.ups.platform.extinterface.entity.task.ULTJobService.generateFileHadoop(ULTJobService.java:707)at com.huawei.wad.ups.platform.extinterface.entity.task.ULTJobService.jobProcessing(ULTJobService.java:165)at com.huawei.wad.ups.platform.extinterface.entity.task.ULTJob.execute(ULTJob.java:79)at com.huawei.wad.ups.platform.service.ultaskmgt.ULTaskHandler.run(ULTaskHandler.java:93)at java.lang.Thread.run(Thread.java:619)Caused by: java.io.IOException: CreateProcess error=2, ?????????at java.lang.ProcessImpl.create(Native Method)at java.lang.ProcessImpl.(ProcessImpl.java:81)at java.lang.ProcessImpl.start(ProcessImpl.java:30)at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)... 22 more

?

原因还没找到,谢谢!

1 楼 houzhaowei 2010-10-22   遇到了同样的问题。。。 求解决方案。。。我用的是windows下的eclipse hadoop插件访问远程linux hadoop 服务,遇到了这个问题。。 2 楼 niqingyang 2012-06-04   我也遇到了这个问题 你现在解决了吗 是怎么解决的呀?

热点排行