设为首页 收藏本站
查看: 614|回复: 0

[经验分享] hama学习笔记(5)-Zookeeper的配置问题一例

[复制链接]

尚未签到

发表于 2017-4-19 11:15:51 | 显示全部楼层 |阅读模式
  hama集群启动后貌似正常,运行ecample:

$ bin/hama jar hama-examples-0.6.0.jar pi


时出错,报无法连接zookeeper:
13/03/21 01:37:41 INFO bsp.BSPJobClient: Running job: job_201303210137_0001
13/03/21 01:37:44 INFO bsp.BSPJobClient: Current supersteps number: 0
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO sync.ZKSyncClient: Initializing ZK Sync Client
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO sync.ZooKeeperSyncClientImpl: Start connecting to Zookeeper! At iir455-199/10.77.30.199:61002
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 ERROR sync.ZooKeeperSyncClientImpl: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /bsp/job_201303210137_0001/peers
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 ERROR sync.ZKSyncClient: Error checking zk path /bsp/job_201303210137_0001/peers/iir455-199:61002
attempt_201303210137_0001_000007_0: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /bsp/job_201303210137_0001/peers/iir455-199:61002
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1041)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1069)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.isExists(ZKSyncClient.java:108)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.writeNode(ZKSyncClient.java:262)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.registerTask(ZooKeeperSyncClientImpl.java:270)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.register(ZooKeeperSyncClientImpl.java:250)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.initializeSyncService(BSPPeerImpl.java:338)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.<init>(BSPPeerImpl.java:169)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.GroomServer$BSPPeerChild.main(GroomServer.java:1262)
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 ERROR sync.ZKSyncClient: Error creating zk path /bsp/job_201303210137_0001/peers/iir455-199:61002
attempt_201303210137_0001_000007_0: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /bsp
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1041)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1069)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.createZnode(ZKSyncClient.java:135)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.writeNode(ZKSyncClient.java:282)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.registerTask(ZooKeeperSyncClientImpl.java:270)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.register(ZooKeeperSyncClientImpl.java:250)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.initializeSyncService(BSPPeerImpl.java:338)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.<init>(BSPPeerImpl.java:169)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.GroomServer$BSPPeerChild.main(GroomServer.java:1262)
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO ipc.Server: Starting SocketReader
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO ipc.Server: IPC Server Responder: starting
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO ipc.Server: IPC Server listener on 61002: starting
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO message.HadoopMessageManagerImpl:  BSPPeer address:iir455-199 port:61002
attempt_201303210137_0001_000007_0: 13/03/21 01:37:16 INFO ipc.Server: IPC Server handler 0 on 61002: starting
attempt_201303210137_0001_000007_0: 13/03/21 01:37:17 ERROR sync.ZKSyncClient: Error checking zk path /bsp/job_201303210137_0001/sync/-1
attempt_201303210137_0001_000007_0: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /bsp/job_201303210137_0001/sync/-1
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1041)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1069)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.isExists(ZKSyncClient.java:108)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.writeNode(ZKSyncClient.java:262)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.enterBarrier(ZooKeeperSyncClientImpl.java:99)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.doFirstSync(BSPPeerImpl.java:345)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.<init>(BSPPeerImpl.java:233)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.GroomServer$BSPPeerChild.main(GroomServer.java:1262)
attempt_201303210137_0001_000007_0: 13/03/21 01:37:17 ERROR sync.ZKSyncClient: Error creating zk path /bsp/job_201303210137_0001/sync/-1
attempt_201303210137_0001_000007_0: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /bsp
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1041)
attempt_201303210137_0001_000007_0: at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1069)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.createZnode(ZKSyncClient.java:135)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZKSyncClient.writeNode(ZKSyncClient.java:282)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.enterBarrier(ZooKeeperSyncClientImpl.java:99)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.doFirstSync(BSPPeerImpl.java:345)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.<init>(BSPPeerImpl.java:233)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.GroomServer$BSPPeerChild.main(GroomServer.java:1262)
attempt_201303210137_0001_000007_0: 13/03/21 01:37:17 FATAL bsp.GroomServer: SyncError from child
attempt_201303210137_0001_000007_0: org.apache.hama.bsp.sync.SyncException
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.sync.ZooKeeperSyncClientImpl.enterBarrier(ZooKeeperSyncClientImpl.java:137)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.doFirstSync(BSPPeerImpl.java:345)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.BSPPeerImpl.<init>(BSPPeerImpl.java:233)
attempt_201303210137_0001_000007_0: at org.apache.hama.bsp.GroomServer$BSPPeerChild.main(GroomServer.java:1262)
13/03/21 01:37:47 INFO bsp.BSPJobClient: Job failed.

  zookeeper用的不是hama自带的,是一个3个节点的集群,查看zookeeper日志(通常在启动zookeeper的用户的home目录下)也是正常的,测试zookeeper:

$ bin/zkCli.sh -server ***:2181


也没有问题。  查看hama的配置文件时发现了问题。hama有两个xml配置文件,hama-site.xml和hama-default.xml.前者可以覆盖后者中的默认配置。
  我在hama-site.xml中配置了hama.zookeeper.quorum,却没有配置zookeeper的端口,本以为默认的应该和zookeeper默认的一样,可不想实际上hama默认的zookeeper端口是21810,而不是2181,所以在hama-site.xml中添加:

  <property>
<name>hama.zookeeper.property.clientPort</name>
<value>2181</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>


  重启hama,运行pi样例,OK了:

[iir@iir455-200 hama-0.6.0]$ bin/hama jar hama-examples-0.6.0.jar pi
13/03/21 01:47:41 INFO bsp.BSPJobClient: Running job: job_201303210147_0001
13/03/21 01:47:44 INFO bsp.BSPJobClient: Current supersteps number: 0
13/03/21 01:47:50 INFO bsp.BSPJobClient: Current supersteps number: 1
13/03/21 01:47:50 INFO bsp.BSPJobClient: The total number of supersteps: 1
13/03/21 01:47:50 INFO bsp.BSPJobClient: Counters: 6
13/03/21 01:47:50 INFO bsp.BSPJobClient:   org.apache.hama.bsp.JobInProgress$JobCounter
13/03/21 01:47:50 INFO bsp.BSPJobClient:     SUPERSTEPS=1
13/03/21 01:47:50 INFO bsp.BSPJobClient:     LAUNCHED_TASKS=21
13/03/21 01:47:50 INFO bsp.BSPJobClient:   org.apache.hama.bsp.BSPPeerImpl$PeerCounter
13/03/21 01:47:50 INFO bsp.BSPJobClient:     SUPERSTEP_SUM=21
13/03/21 01:47:50 INFO bsp.BSPJobClient:     TIME_IN_SYNC_MS=7313
13/03/21 01:47:50 INFO bsp.BSPJobClient:     TOTAL_MESSAGES_SENT=21
13/03/21 01:47:50 INFO bsp.BSPJobClient:     TOTAL_MESSAGES_RECEIVED=21
Estimated value of PI is3.1463428571428564
Job Finished in 10.379 seconds

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-366329-1-1.html 上篇帖子: hbase 和 zookeeper 的伪分布及集群安装 下篇帖子: zookeeper应用场景及相关知识
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表