新的堆栈交换和Giraph所以请忽略错误并提出任何澄清问题。
操作系统:ubuntu 13.10
Hadoop / Yarn:hadoop-2.2.0 /(2节点集群)
Giraph:1.0.0(编辑:主干)
当我尝试运行以下示例时,我收到NullPointerException(NPE):
$ hadoop jar $ GIRAPH_HOME / giraph-例子/目标/ giraph-例子-1.1.0-SNAPSHOT换的Hadoop-2.2.0-JAR与 - dependencies.jar org.apache.giraph.GiraphRunner org.apache.giraph.examples.SimpleShortestPathsComputation -vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip /user/hduser/rrdata/tiny_graph.txt -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/hduser/rrdata/output/tiny_graph.out -w 1
堆栈追踪:
似乎与动物园管理员有关。我安装了zookeeper但没有使用它之前看起来配置是错误的。我尝试了线程“main”中的异常java.lang.NullPointerException at org.apache.giraph.yarn.GiraphYarnClient.checkJobLocalZooKeeperSupported(GiraphYarnClient.java:460) 在 org.apache.giraph.yarn.GiraphYarnClient.run(GiraphYarnClient.java:116) 在org.apache.giraph.GiraphRunner.run(GiraphRunner.java:96)at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)at org.apache.giraph.GiraphRunner.main(GiraphRunner.java:126)at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:606)at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
-Dgiraph.zkList=hostname:port
及相关选项,但获得了“无法识别的选项”例外。
为此方案寻找正确的zookeeper设置。如果我搞清楚的话,我会发布回复。
答案 0 :(得分:1)
这是一个如何指定-D标志的示例:
hadoop jar giraph-examples-1.1.0-SNAPSHOT-for-hadoop-2.2-jar-with-dependencies.jar org.apache.giraph.GiraphRunner -D giraph.zkList="zkNode.net:2081" org.apache.giraph.examples.SimpleShortestPathsComputation -vif org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip /user/rav/giraph/input/tiny_graph.txt -vof org.apache.giraph.io.formats.IdWithValueTextOutputFormat -op /user/rav/giraph/output/shortestpaths -w 1
Giraph还不支持Btw本地zookeeper(GiraphYarnClient):
/**
* Check if the job's configuration is for a local run. These can all be
* removed as we expand the functionality of the "pure YARN" Giraph profile.
*/
private void checkJobLocalZooKeeperSupported() {
final boolean isZkExternal = giraphConf.isZookeeperExternal();
final String checkZkList = giraphConf.getZookeeperList();
if (!isZkExternal || checkZkList.isEmpty()) {
throw new IllegalArgumentException("Giraph on YARN does not currently" +
"support Giraph-managed ZK instances: use a standalone ZooKeeper.");
}
}
不幸的是checkZkList是NULL所以你永远不会看到这个异常:)
答案 1 :(得分:1)
NPE的原因可能是缺少用于检查ZK设置的giraphConf。我认为这是由于早期的问题。看起来像使用-yj参数未提供jar示例。你用“hadoop jar”运行的jar通常是giraph-core本身。
祝你好运,如果您遇到更多麻烦,请在Giraph用户列表上发帖。