我正在尝试运行Giraph Quick Start中描述的SimpleShortestPathsVertex(aka 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上运行(转到{{ 1}},登录admin / admin,服务选项卡,ZooKeeper并将端口更改为22181,保存和服务操作 - >重新启动。
有没有人有更好的解决方案来解决这个问题?是否存在应该指定端口的配置,或者Giraph源代码中的此端口是错误的?
答案 0 :(得分:0)
是的,您可以使用选项-Dgiraph.zkList=localhost:2181
此外,您可以在Hadoop配置中进行设置,然后每次提交Giraph作业时都不必传递此选项。为此,在conf/core-site.xml
文件中添加以下行:
<property><name>giraph.zkList</name><value>localhost:2181</value></property>
[请检查语法,我不记得它在我的脑海中,目前我无法访问群集进行检查]