7 注意
如果出现java.io.IOException: No valid local directories in property: mapred.local.dir的错误,说明你的客户机的mapred-site.xml是从hadoop集群拷贝过来的,没有修改过,mapred.local.dir是一个本地目录,集群上的机器有这个目录,但是你的本机上没有,所以出现了这个错误。解决办法是,在本地新建一个目录,然后把mapred.local.dir设置为这个路径。
完全按照你的 版本和集群方式 报错如下:
[mw_shl_code=shell,true]16/06/02 02:11:00 INFO client.RMProxy: Connecting to ResourceManager at CentOS641/192.168.159.120:8032
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: file:/home/root/tmp/mapred/temp/inject-temp-2069906004, expected: hdfs://CentOS641:8020
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:642)
at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:181)
at org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:92)
at org.apache.hadoop.hdfs.DistributedFileSystem$11.doCall(DistributedFileSystem.java:585)
at org.apache.hadoop.hdfs.DistributedFileSystem$11.doCall(DistributedFileSystem.java:581)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.delete(DistributedFileSystem.java:581)
at org.apache.nutch.crawl.Injector.inject(Injector.java:301)
at org.apache.nutch.crawl.Crawl.run(Crawl.java:132)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.nutch.crawl.Crawl.main(Crawl.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)[/mw_shl_code]