当前位置: 首页 > 工具软件 > Apache Giraph > 使用案例 >

Giraph 运行常见错误

田昊天
2023-12-01

1. Could not find or load main class org.apache.giraph.yarn.GiraphApplicationMaster

16/08/30 08:45:13 ERROR yarn.GiraphYarnClient: Giraph: org.apache.giraph.examples.SimpleShortestPathsComputation reports FAILED state, diagnostics show: Application application_1472465026418_0008 failed 2 times due to AM Container for appattempt_1472465026418_0008_000002 exited with  exitCode: 1 due to: Exception from container-launch: ExitCodeException exitCode=1: 

ExitCodeException exitCode=1: 

at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)

at org.apache.hadoop.util.Shell.run(Shell.java:455)

at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:702)

at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:195)

at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:300)

at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:81)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Container exited with a non-zero exit code 1.Failing this attempt.. Failing the application.

出现该错误时在命令行运行的命令为:

  1. $> hadoop jar /home/giraph/giraph-examples/target/giraph-examples-1.2.0-SNAPSHOT-for-hadoop-2.5.2-jar-with-dependencies.jar
  2. org.apache.giraph.GiraphRunner
  3. org.apache.giraph.examples.SimpleShortestPathsComputation -vif
  4. org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
  5. -vip /user/input/tiny_graph.txt -vof
  6. org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op
  7. /user/giraph_output/shortestpaths -w 4 -yj
  8. /home/giraph/giraph-examples/target/giraph-examples-1.2.0-SNAPSHOT-for-hadoop-2.5.2-jar-with-dependencies.jar

在网上查到说好像是绝对路径的问题,于是创建软链接试试:

  1. ln -s /home/giraph/giraph-examples/target/giraph-examples-1.2.0-SNAPSHOT-for-hadoop-2.5.2-jar-with-dependencies.jar

然后重新运行命令行:

  1. $> hadoop jar giraph-examples-1.2.0-SNAPSHOT-for-hadoop-2.5.2-jar-with-dependencies.jar
  2. org.apache.giraph.GiraphRunner
  3. org.apache.giraph.examples.SimpleShortestPathsComputation -vif
  4. org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat
  5. -vip /user/input/tiny_graph.txt -vof
  6. org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op
  7. /user/giraph_output/shortestpaths -w 4 -yj
  8. giraph-examples-1.2.0-SNAPSHOT-for-hadoop-2.5.2-jar-with-dependencies.jar

发现可以工作了。


 类似资料: