吉拉夫ZooKeeper端口问题 [英] Giraph ZooKeeper port problems

查看:179
本文介绍了吉拉夫ZooKeeper端口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行 Giraph快速入门中描述的SimpleShortestPathsVertex(aka SimpleShortestPathComputation)示例. .我正在使用VirtualBox在Hortonworks沙盒实例(HDP 2.1)上运行此程序,并使用配置文件hadoop_2.0.0打包了giraph.jar.

I am trying to run the SimpleShortestPathsVertex (aka SimpleShortestPathComputation) example described in the Giraph Quick Start. I am running this on a Hortonworks Sandbox instance (HDP 2.1) using VirtualBox, and I packaged giraph.jar using profile hadoop_2.0.0.

当我尝试使用

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上运行(转到,依次登录admin/admin,服务"选项卡,ZooKeeper,并将端口更改为22181,然后保存并执行服务操作"->全部重新启动".

I have found a work around - it seems that Giraph expects ZooKeeper to be running on port 22181, while it is actually running on 2181. I have simply used the Ambari interface to set ZooKeeper to run on 22181 (go to http://127.0.0.1:8080/, login admin/admin, Services tab, ZooKeeper and change the port to 22181, save and Service Actions -> Restart All.

有人对此问题有更好的解决方案吗?是否有配置可用来指定端口,或者在Giraph源代码中此端口是错字?

Does anyone have a better solution for this problem? Is there a config via which the port should be specified, or is this port in the Giraph source code a typo?

推荐答案

是的,您可以使用选项-Dgiraph.zkList=localhost:2181

Yes, you can specify each time you run a Giraph job via using option -Dgiraph.zkList=localhost:2181

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

Also you can set it up in Hadoop configs and then you don't have to pass on this option each time you submit a Giraph job. For that add the following line in conf/core-site.xml file :

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

[请检查语法,我不记得它的语法,目前我无法访问群集进行检查]

[Please check the syntax, I don't recall it on top my head and currently I don't have access to a cluster to check it]

这篇关于吉拉夫ZooKeeper端口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆