1、执行脚本程序报如下所示的错误:
[hadoop@slaver1 script_hadoop]$ hadoop jar web_click_mr_hive.jar com.bie.hive.mr.ClickStreamThree /home/hadoop/data_hadoop/weblog/preprocess/output/-- /home/hadoop/data_hadoop/weblog/preprocess/click_pv_out/--
// :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.io.IOException: No FileSystem for scheme: C
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem.access$(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(FileInputFormat.java:)
at com.bie.hive.mr.ClickStreamThree.main(ClickStreamThree.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hadoop.util.RunJar.main(RunJar.java:)
[hadoop@slaver1 script_hadoop]$ hadoop jar web_click_mr_hive.jar com.bie.hive.mr.ClickStreamThree hdfs://slaver1:9000/home/hadoop/data_hadoop/weblog/preprocess/output/2018-05-19 hdfs://slaver1:9000/home/hadoop/data_hadoop/weblog/preprocess/click_pv_out/2018-05-19
// :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.io.IOException: No FileSystem for scheme: C
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem.access$(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(FileInputFormat.java:)
at com.bie.hive.mr.ClickStreamThree.main(ClickStreamThree.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hadoop.util.RunJar.main(RunJar.java:)
[hadoop@slaver1 script_hadoop]$
2、猛一看,WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable,百度一搜这个错误,啥编译32/64位的问题,也有说改配置文件的问题,也许有的可能是这样改就解决问题了,而我想说,出现问题,看看报错原因,也许就可以很快的解决问题了。
然后呢,看下代码,是如下所示导致的错误,将下面的注释了,代码换成上面的就可以使用脚本程序执行代码了:
FileInputFormat.setInputPaths(job, new Path(args[]));
FileOutputFormat.setOutputPath(job, new Path(args[])); //FileInputFormat.setInputPaths(job, new Path("C:/weblog/output"));
//FileOutputFormat.setOutputPath(job, new Path("c:/weblog/pageviews"));