分享

MR程序运行的一个疑惑,求解释,谢谢

supertianxiang 发表于 2015-12-10 16:02:31 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 6 10357
程序功能:MapReduce程序,从hbase里面取搜索日志,生成搜索下拉服务的数据。
问题:
  程序采用Extract required libraries into generated jar,packate requited libraries into generated jar打包的时候,在eclipse下debug with configuration,运行正常。
  但是用hadoop jar调用的时候会报错,错误信息如下
  1 15/12/10 15:53:47 INFO suggestlist.DataCollector: ---------------Suggestlist data analysis begin to execute -------------
  2 ---------------Suggestlist data analysis begin to execute -------------
  3 hdfs path is hdfs://192.168.10.225:9000 -----这几个是程序传进云的参数,跟eclipse里面运行时打印的一致
  4 output path is /org/jinher/search/suggestlist
  5 resourcemanager is 192.168.10.225:8032
  6 tarname is /export/search/dataanalysis/jar/SuggestListScheduler.jar
  7 zkcluster is localhost:2181
  8 15/12/10 15:53:47 INFO suggestlist.DataCollector: step 1,DataCollector is running
  9 SLF4J: Class path contains multiple SLF4J bindings.
10 SLF4J: Found binding in [rsrc:org/slf4j/impl/StaticLoggerBinder.class]
11 SLF4J: Found binding in [jar:rsrc:slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
12 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
13 SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
14 java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: rsrc:hbase-common-0.98.9-hadoop2.jar
15     at org.apache.hadoop.fs.Path.initialize(Path.java:206)
16     at org.apache.hadoop.fs.Path.<init>(Path.java:172)
17     at org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.findOrCreateJar(TableMapReduceUtil.java:821)
18     at org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addDependencyJars(TableMapReduceUtil.java:774)
19     at org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil.addHBaseDependencyJars(TableMapReduceUtil.java:690)
20     at org.jinher.search.suggestlist.DataCollector.run(DataCollector.java:131)
21     at org.jinher.search.suggestlist.SuggestListScheduler.run(SuggestListScheduler.java:78)
22     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
23     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
24     at org.jinher.search.suggestlist.SuggestListScheduler.main(SuggestListScheduler.java:26)
25     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
26     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
27     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
28     at java.lang.reflect.Method.invoke(Method.java:606)
29     at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
30     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
31     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
32     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
33     at java.lang.reflect.Method.invoke(Method.java:606)
34     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
35 Caused by: java.net.URISyntaxException: Relative path in absolute URI: rsrc:hbase-common-0.98.9-hadoop2.jar
36     at java.net.URI.checkPath(URI.java:1804)
37     at java.net.URI.<init>(URI.java:752)
38     at org.apache.hadoop.fs.Path.initialize(Path.java:203)
39     ... 19 more                                            

程序采用copy required libraries into a sub-folder next to the genered JAR 打包的时候在,eclipse下debug with configuration,运行正常,hadoop jar 运行也正常,,那位大牛能解释一下为啥呢?谢谢

已有(6)人评论

跳转到指定楼层
langke93 发表于 2015-12-10 18:13:33
supertianxiang 发表于 2015-12-10 17:53
你好,感谢回复,按这两种方式Extract required libraries into generated jar,packate requited lib ...

还是打包的问题,要么都打进去,要么把包弄到环境中
回复

使用道具 举报

langke93 发表于 2015-12-10 17:17:05
环境一边,参数没有变,可能会造成这种情况,还有包等都齐全了。比如这个错误

java.net.URISyntaxException: Relative path in absolute URI: rsrc:hbase-common-0.98.9-hadoop2.jar



是说本地路径使用的绝对URI,意思也就是我们当我们编程的时候,可能使用的是本地路径,但是一旦放到服务器上运行,本地路径是没有的。当然这里只是举例,楼主注意检查本地和云的区别,比如程序路径,程序所需jar包。等等
回复

使用道具 举报

supertianxiang 发表于 2015-12-10 17:53:30
langke93 发表于 2015-12-10 17:17
环境一边,参数没有变,可能会造成这种情况,还有包等都齐全了。比如这个错误

java.net.URISyntaxExcept ...

    你好,感谢回复,按这两种方式Extract required libraries into generated jar,packate requited libraries into generated jar 打包的话不行,按道理说应该所有的依赖都条进去了呀。
   我是搞C++的,不是太熟悉环境这块,后来我把hbase-common那个包remove了,重新add就复现不了了,感觉你是某个动作把依赖的包更新到了分布式环境里面了,所以就再也不出来了。
回复

使用道具 举报

cranberries8 发表于 2015-12-14 21:05:30
这个的排查问题的方法就是:
    1.你在hadoop 的执行脚本中将最后将classpath 打印出来看是否包含你缺失的jar包  hbase-common-0.98.9-hadoop2.jar  就可以咯 ,
    2.确认你是否在所有包含nodemanager 的服务器都配置了该 jar包
回复

使用道具 举报

supertianxiang 发表于 2015-12-16 09:46:40
cranberries8 发表于 2015-12-14 21:05
这个的排查问题的方法就是:
    1.你在hadoop 的执行脚本中将最后将classpath 打印出来看是否包含你缺失 ...

多谢,下次再遇到试试
回复

使用道具 举报

plplhpy 发表于 2015-12-16 12:59:51
也遇到类是问题···
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条