我是hadoop新手。
我正在尝试设置giraph在hadoop-2.6.5上运行。
当我提交giraph作业时,作业成功提交,但失败,我在容器syslog中得到以下日志:
2018-01-30 12:09:01190 info[main]org.apache.hadoop.mapreduce.v2.app.mrappmaster:为应用程序appattempt\u 1517293264136\u 0002\u000002 2018-01-30 12:09:01437 warn[main]org.apache.hadoop.util.nativecodeloader:无法为您的平台加载本机hadoop库。。。在适用的情况下使用内置java类2018-01-30 12:09:01471 info[main]org.apache.hadoop.mapreduce.v2.app.mrappmaster:使用令牌执行:2018-01-30 12:09:01471 info[main]org.apache.hadoop.mapreduce.v2.app.mrappmaster:种类:yarn\u am\u rm\u令牌,服务:,ident:(appattemptid{application\u id{id:2 cluster\u timestamp:1517293264136}attemptid:2}keyid:-1485907628)2018-01-30 12:09:01583 info[main]org.apache.hadoop.mapreduce.v2.app.mrappmaster:使用mapred newapicommitter。2018-01-30 12:09:02154 info[main]org.apache.hadoop.mapreduce.v2.app.mrappmaster:outputcommitter set in config null 2018-01-30 12:09:02,207 fatal[main]org.apache.hadoop.mapreduce.v2.app.mrappmaster:启动mrappmaster java.lang.noclassdeffounderror:io/netty/buffer/bytebufallocator at org.apache.giraph.bsp.bspoutputformat.getoutputcommitter(bspoutputformat)时出错。java:62)在org.apache.hadoop.mapreduce.v2.app.mrappmaster$1.call(mrappmaster。java:470)在org.apache.hadoop.mapreduce.v2.app.mrappmaster$1.call(mrappmaster。java:452)在org.apache.hadoop.mapreduce.v2.app.mrappmaster.callwithjobclassloader(mrappmaster。java:1541)在org.apache.hadoop.mapreduce.v2.app.mrappmaster.createoutputcommitter(mrappmaster。java:452)在org.apache.hadoop.mapreduce.v2.app.mrappmaster.serviceinit(mrappmaster。java:371) 在org.apache.hadoop.service.abstractservice.init(abstractservice。java:163)在org.apache.hadoop.mapreduce.v2.app.mrappmaster$4.run(mrappmaster。java:1499)位于javax.security.auth.subject.doas(subject)的java.security.accesscontroller.doprivileged(本机方法)。java:422)在org.apache.hadoop.security.usergroupinformation.doas(用户组信息。java:1692)在org.apache.hadoop.mapreduce.v2.app.mrappmaster.initandstartapmaster(mrappmaster。java:1496)位于org.apache.hadoop.mapreduce.v2.app.mrappmaster.main(mrappmaster.com)。java:1429)原因:java.lang.classnotfoundexception:io.netty.buffer.bytebufallocator atjava.net.urlclassloader.findclass(urlclassloader。java:381)在java.lang.classloader.loadclass(classloader。java:424)在sun.misc.launcher$appclassloader.loadclass(launcher。java:331)在java.lang.classloader.loadclass(classloader。java:357) ... 更多信息2018-01-30 12:09:02209信息[main]org.apache.hadoop.util.exitil:退出状态1
日志中的诊断显示以下日志:
应用程序应用程序\u 1517293264136 \u 0002失败2次,原因是appattempt的am容器\u 1517293264136 \u 0002 \u000002退出,exitcode:1有关更详细的输出,请检查应用程序跟踪page:http用法:/172.16.0.218:8088/proxy/application\u 1517293264136\u 0002/然后,单击指向每次尝试的日志的链接。诊断:容器启动异常。容器id:container\u 1517293264136\u 0002\u 02\u000001退出代码:1堆栈跟踪:exitcodeexception exitcode=1:at org.apache.hadoop.util.shell.runcommand(shell)。java:575)在org.apache.hadoop.util.shell.run(shell。java:478)在org.apache.hadoop.util.shell$shellcommandexecutor.execute(shell。java:766)在org.apache.hadoop.yarn.server.nodemanager.defaultcontainerexecutor.launchcontainer(defaultcontainerexecutor)。java:212)在org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.containerlaunch.call(containerlaunch。java:302)在org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.containerlaunch.call(containerlaunch。java:82)在java.util.concurrent.futuretask.run(futuretask。java:266)位于java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor。java:1142)在java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor。java:617)在java.lang.thread.run(线程。java:745)容器退出,退出代码为非零,尝试失败。应用程序失败。
它不及格的班级是 io/netty/buffer/ByteBufAllocator
在netty所有的jar里:https://mvnrepository.com/artifact/io.netty/netty-all
从其他问题来看,我尝试过在hadoop\u类路径中添加jar。
Yogin-Patel:hadoop yoginpatel$ echo $HADOOP_CLASSPATH
/Users/yoginpatel/Downloads/gradle-4.3/caches/modules-2/files-2.1/io.netty/netty-all/4.0.43.Final/9781746a179070e886e1fb4b1971a6bbf02061a4/netty-all-4.0.43.Final.jar
Yogin-Patel:hadoop yoginpatel$
它出现在 hadoop classpath
也。
Yogin-Patel:hadoop yoginpatel$ hadoop classpath
/Users/yoginpatel/hadoop/etc/hadoop:/Users/yoginpatel/hadoop/share/hadoop/common/lib/*:/Users/yoginpatel/hadoop/share/hadoop/common/*:/Users/yoginpatel/hadoop/share/hadoop/hdfs:/Users/yoginpatel/hadoop/share/hadoop/hdfs/lib/*:/Users/yoginpatel/hadoop/share/hadoop/hdfs/*:/Users/yoginpatel/hadoop/share/hadoop/yarn/lib/*:/Users/yoginpatel/hadoop/share/hadoop/yarn/*:/Users/yoginpatel/hadoop/share/hadoop/mapreduce/lib/*:/Users/yoginpatel/hadoop/share/hadoop/mapreduce/*:/Users/yoginpatel/Downloads/gradle-4.3/caches/modules-2/files-2.1/io.netty/netty-all/4.0.43.Final/9781746a179070e886e1fb4b1971a6bbf02061a4/netty-all-4.0.43.Final.jar:/contrib/capacity-scheduler/*.jar
Yogin-Patel:hadoop yoginpatel$
我正在尝试在开发环境中设置。这是单节点设置。
我甚至试过
job.addFileToClassPath(new Path("/Users/yoginpatel/Downloads/gradle-4.3/caches/modules-2/files-2.1/io.netty/netty-all/4.0.43.Final/9781746a179070e886e1fb4b1971a6bbf02061a4/netty-all-4.0.43.Final.jar"));
这些方法都没用。如何让hadoop节点访问必要的jar?
这是一个giraphjob submit代码,它将map reduce job提交到集群:
@Test
public void testPageRank() throws IOException, ClassNotFoundException, InterruptedException {
GiraphConfiguration giraphConf = new GiraphConfiguration(getConf());
giraphConf.setWorkerConfiguration(1,1,100);
GiraphConstants.SPLIT_MASTER_WORKER.set(giraphConf, false);
giraphConf.setVertexInputFormatClass(JsonLongDoubleFloatDoubleVertexInputFormat.class);
GiraphFileInputFormat.setVertexInputPath(giraphConf,
new Path("/input/tiny-graph.txt"));
giraphConf.setVertexOutputFormatClass(IdWithValueTextOutputFormat.class);
giraphConf.setComputationClass(PageRankComputation.class);
GiraphJob giraphJob = new GiraphJob(giraphConf, "page-rank");
giraphJob.getInternalJob().addFileToClassPath(new Path("/Users/yoginpatel/Downloads/gradle-4.3/caches/modules-2/files-2.1/io.netty/netty-all/4.0.43.Final/9781746a179070e886e1fb4b1971a6bbf02061a4/netty-all-4.0.43.Final.jar"));
FileOutputFormat.setOutputPath(giraphJob.getInternalJob(),
new Path("/output/page-rank2"));
giraphJob.run(true);
}
private Configuration getConf() {
Configuration conf = new Configuration();
conf.set("fs.defaultFS", "hdfs://localhost:9000");
conf.set("yarn.resourcemanager.address", "localhost:8032");
// framework is now "yarn", should be defined like this in mapred-site.xm
conf.set("mapreduce.framework.name", "yarn");
return conf;
}
1条答案
按热度按时间q43xntqr1#
我把giraph的jar和依赖项放在hadoop lib路径中,就可以工作了: