0

我正在尝试运行Giraph Quick Start中描述的 SimpleShortestPathsVertex(又名 SimpleShortestPathComputation)示例。我正在使用 VirtualBox 在 Hortonworks Sandbox 实例 (HDP 2.1) 上运行它,并使用配置文件 hadoop_2.0.0 打包 giraph.jar。

当我尝试使用运行示例时

hadoop jar giraph.jar org.apache.giraph.GiraphRunner 
org.apache.giraph.examples.SimpleShortestPathsVertex -vif 
org.apache.giraph.io.formats.JsonLongDoubleFloatDoubleVertexInputFormat -vip 
/user/hue/tinygraph.txt -of org.apache.giraph.io.formats.IdWithValueTextOutputFormat 
-op /user/hue/output/shortestpaths -w 1

我得到以下异常

2014-04-30 07:22:15,390 INFO [main] org.apache.giraph.zk.ZooKeeperManager: onlineZooKeeperServers: Connect attempt 0 of 10 max trying to connect to sandbox.hortonworks.com:22181 with poll msecs = 3000
2014-04-30 07:22:15,396 WARN [main] org.apache.giraph.zk.ZooKeeperManager: onlineZooKeeperServers: Got ConnectException
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.giraph.zk.ZooKeeperManager.onlineZooKeeperServers(ZooKeeperManager.java:701)
at org.apache.giraph.graph.GraphTaskManager.startZooKeeperManager(GraphTaskManager.java:357)
at org.apache.giraph.graph.GraphTaskManager.setup(GraphTaskManager.java:188)
at org.apache.giraph.graph.GraphMapper.setup(GraphMapper.java:60)
at org.apache.giraph.graph.GraphMapper.run(GraphMapper.java:90)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:340)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
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:1548)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)

我找到了一个解决方法 - 似乎 Giraph 期望 ZooKeeper 在端口 22181 上运行,而它实际上在 2181 上运行。我只是使用 Ambari 界面将 ZooKeeper 设置为在 22181 上运行(转到http://127.0.0.1:8080/,登录 admin/admin ,Services选项卡,ZooKeeper并将端口更改为22181,保存并Service Actions -> Restart All。

有没有人对这个问题有更好的解决方案?是否有应该指定端口的配置,或者 Giraph 源代码中的这个端口是错字?

4

1 回答 1

0

是的,您可以通过 using 选项指定每次运行 Giraph 作业的时间-Dgiraph.zkList=localhost:2181

您也可以在 Hadoop 配置中进行设置,然后您不必在每次提交 Giraph 作业时都传递此选项。为此,在conf/core-site.xml文件中添加以下行:

<property><name>giraph.zkList</name><value>localhost:2181</value></property>

[请检查语法,我不记得它在我头上,目前我无权访问集群来检查它]

于 2014-08-05T17:26:38.700 回答