因此,我已经通过如下所示的脚本在我的计算机上成功地执行了SimpleShortestPathComputation:
#VARIABLES
user_dir=/user/hduser
jar=giraph-examples/target/giraph-examples-1.1.0-for-hadoop-2.4.0-jar-with-dependencies.jar
runner=org.apache.giraph.GiraphRunner
computation=org.apache.giraph.examples.SimpleShortestPathsComputation
informat=org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
outformat=org.apache.giraph.io.formats.IdWithValueTextOutputFormat
#DELETE PREVIOUS
bin/hdfs dfs -rm -r $user_dir/output/shortestpaths
#GIRAPH JOB
bin/hadoop jar $GIRAPH_HOME/$jar $runner -Dgiraph.yarn.task.heap.mb=3000 $computation -vif $informat -vip $user_dir/input/tiny_graph.txt -vof $outformat -op $user_dir/output/shortestpaths -w 1现在的问题是,我正在尝试运行我自己的工作。它实际上是从SimpleShortestPathComputation类直接复制粘贴的,只是更改了包名和类名。正在尝试用-libjars运行它。下面是完整的脚本:
#VARIABLES
user_dir=/user/hduser
jar=giraph-examples/target/giraph-examples-1.1.0-for-hadoop-2.4.0-jar-with-dependencies.jar
runner=org.apache.giraph.GiraphRunner
computation=org.apache.giraph.examples.SimpleShortestPathsComputation
informat=org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
outformat=org.apache.giraph.io.formats.IdWithValueTextOutputFormat
libjars=/usr/local/hadoop-2.4.0/lib/giraphtrials.jar,$GIRAPH_HOME/giraph-core.jar
#Setup class paths
export HADOOP_CLASSPATH=/usr/local/hadoop-2.4.0/lib/giraphtrials.jar:$GIRAPH_HOME/$jar:$HADOOP_CLASSPATH
#DELETE PREVIOUS
bin/hdfs dfs -rm -r $user_dir/output/shortestpaths
#GIRAPH JOB
bin/hadoop jar $GIRAPH_HOME/$jar $runner -libjars $libjars \
GiraphAlgs.GiraphPBFS -vif $informat -vip $user_dir/input/tiny_graph.txt \
-vof $outformat -op $user_dir/output/shortestpaths -w 1正如你所看到的,我已经尝试使用来自this Stackoverflow question的-libjars和HADOOP_CLASSPATH建议来让它工作,但不幸的是它仍然给我一个ClassNotFoundException。不管是好是坏,它不再在终端中向我扔它了(它曾经是):terminal picture。正如您所看到的,它现在只在一般的容器消息中失败。
不幸的是,它仍然给我提供了日志中的Java.lang.ClassNotFoundException:log picture。使用Hadoop 2.4.0和Giraph 1.1.0。我已经没有想法了,我的Giraph可能出了什么问题,我开始考虑是否应该换个职业。
发布于 2018-03-14 11:32:50
您需要在hadoop类路径中拥有包含类GiraphAlgs.GiraphPBFS的jar。
另外,通过运行$bin/hadoop classpath验证您的类路径设置是否正确。
一旦在Hadoop2.7中设置HADOOP_CLASSPATH变量不起作用,我就不得不复制hadoop share lib目录中的jar:HADOOP_HOME/share/hadoop/mapreduce/lib。
https://stackoverflow.com/questions/48845639
复制相似问题