我正在使用 Giraph 开发一种算法。我正在Hadoop 1.2.1 上使用 1.0.0 版本。
我对开发 Giraph 还是很陌生,所以请保持温柔;)
我的自定义作业分为三个包:
- io:包含输入输出格式类
- layout:包含 Vertex 类、Aggregator 类和 MasterCompute 类。
- run:包含工具实现类。
我在 Eclipse 中使用构建的 giraph-core jar 作为参考对其进行编程,然后将其导出到另一个名为“customJob.jar”的 jar 中。
这是我在 Hadoop 中启动它的方式:
hadoop jar /opt/hadoop/lib/customJob.jar layout.customrVertex -vif
io.JSONLongDoubleFloatDoubleToMapVertexInputFormat -vip /users/hadoop/input/tiny_graph.txt
-of io.VertexIdAndPositionOutputFormat -op /users/hadoop/output/customJob -w 1
Job 启动,进入 MapReduce 阶段,然后失败:
14/12/16 17:39:35 INFO job.GiraphJob: run: Since checkpointing is disabled (default), do not allow any task retries (setting mapred.map.max.attempts = 0, old value = 4)
14/12/16 17:39:37 INFO mapred.JobClient: Running job: job_201412161121_0025
14/12/16 17:39:38 INFO mapred.JobClient: map 0% reduce 0%
14/12/16 17:39:49 INFO mapred.JobClient: Job complete: job_201412161121_0025
14/12/16 17:39:49 INFO mapred.JobClient: Counters: 4
14/12/16 17:39:49 INFO mapred.JobClient: Job Counters
14/12/16 17:39:49 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=9487
14/12/16 17:39:49 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0
14/12/16 17:39:49 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0
14/12/16 17:39:49 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0
对 JobTracker 的进一步调查显示 JobSetup 失败,出现 ClassNotFoundException 错误:
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: layout.customVertex
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:889)
at org.apache.giraph.conf.ClassConfOption.get(ClassConfOption.java:94)
at org.apache.giraph.conf.GiraphClasses.readFromConf(GiraphClasses.java:152)
at org.apache.giraph.conf.GiraphClasses.<init>(GiraphClasses.java:142)
at org.apache.giraph.conf.ImmutableClassesGiraphConfiguration.<init>(ImmutableClassesGiraphConfiguration.java:93)
at org.apache.giraph.bsp.BspOutputFormat.getOutputCommitter(BspOutputFormat.java:56)
at org.apache.hadoop.mapred.Task.initialize(Task.java:515)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: layout.customVertex
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:857)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:881)
... 12 more
Caused by: java.lang.ClassNotFoundException: layout.customVertex
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:810)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:855)
... 13 more
Hadoop 配置是 Giraph 快速入门页面中建议的配置。
我将不胜感激您可以提供的任何帮助/建议:)
提前致谢!