`

HRegionServer: ZooKeeper session expired

阅读更多

Hbase不稳定,分析日志发现,归纳总结,目前发现共存在两个问题,一个就是上篇博客提到的问题,还有个问题就是zookeeper的问题

 

我的异常输出为:

2010-10-28 00:36:49,573 WARN org.apache.zookeeper.ClientCnxn: Exception closing session 0x9d2be33dbe860005 to sun.nio.ch.SelectionKeyImpl@6655bb93
java.io.IOException: Read error rc = -1 java.nio.DirectByteBuffer[pos=0 lim=4 cap=4]
        at org.apache.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:701)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:945)
2010-10-28 00:36:49,602 WARN org.apache.zookeeper.ClientCnxn: Ignoring exception during shutdown input
java.net.SocketException: Transport endpoint is not connected
        at sun.nio.ch.SocketChannelImpl.shutdown(Native Method)
        at sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:658)
        at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:378)
        at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:999)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:970)
2010-10-28 00:36:49,602 WARN org.apache.zookeeper.ClientCnxn: Ignoring exception during shutdown output
java.net.SocketException: Transport endpoint is not connected
        at sun.nio.ch.SocketChannelImpl.shutdown(Native Method)
        at sun.nio.ch.SocketChannelImpl.shutdownOutput(SocketChannelImpl.java:669)
        at sun.nio.ch.SocketAdaptor.shutdownOutput(SocketAdaptor.java:386)
        at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1004)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:970)
2010-10-28 00:36:49,622 WARN org.apache.hadoop.hbase.regionserver.HRegionServer: Attempt=1
org.apache.hadoop.hbase.Leases$LeaseStillHeldException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at org.apache.hadoop.hbase.RemoteExceptionHandler.decodeRemoteException(RemoteExceptionHandler.java:94)
        at org.apache.hadoop.hbase.RemoteExceptionHandler.checkThrowable(RemoteExceptionHandler.java:48)
        at org.apache.hadoop.hbase.RemoteExceptionHandler.checkIOException(RemoteExceptionHandler.java:66)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:549)
        at java.lang.Thread.run(Thread.java:636)
2010-10-28 00:36:49,703 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Got ZooKeeper event, state: Disconnected, type: None, path: null
2010-10-28 00:36:50,505 INFO org.apache.zookeeper.ClientCnxn: Attempting connection to server /192.168.5.151:2181
2010-10-28 00:36:50,505 INFO org.apache.zookeeper.ClientCnxn: Priming connection to java.nio.channels.SocketChannel[connected local=/192.168.5.156:49407 remote=/192.168.5.151:2181]
2010-10-28 00:36:50,506 INFO org.apache.zookeeper.ClientCnxn: Server connection successful
2010-10-28 00:36:50,507 WARN org.apache.zookeeper.ClientCnxn: Exception closing session 0x9d2be33dbe860005 to sun.nio.ch.SelectionKeyImpl@335819e4
java.io.IOException: Session Expired
        at org.apache.zookeeper.ClientCnxn$SendThread.readConnectResult(ClientCnxn.java:589)
        at org.apache.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:709)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:945)
2010-10-28 00:36:50,507 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Got ZooKeeper event, state: Expired, type: None, path: null
2010-10-28 00:36:50,507 ERROR org.apache.hadoop.hbase.regionserver.HRegionServer: ZooKeeper session expired

 

然后,区域节点就会exit!

 

对了,介绍个好地方哦:http://wiki.apache.org/hadoop/Hbase/Troubleshooting

这里会有些你碰到的问题,对了还个汇总的地方,也介绍下:http://bbs.hadoopor.com/thread-71-1-1.html

 

说说解决方法:

设置zookeeper的过期时间长一点,默认的过期时间(zookeeper.session.timeout )是60秒,参看这里: http://hbase.apache.org/docs/r0.20.6/hbase-conf.html

他和另外个因素(hbase.zookeeper.property.tickTime )配合使用。

我设置如下:

<property>
    <name>zookeeper.session.timeout</name>
    <value>90000</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.tickTime</name>
    <value>9000</value>
  </property>

 

在段时间内,没有发现再出问题,不知道是否根解了。

另外注意细读理解这里的列出来的几点:

Resolution

 

  • Make sure you give plenty of RAM (in hbase-env.sh), the default of 1GB won't be able to sustain long running imports.
  • Make sure you don't swap, the JVM never behaves well under swapping.
  • Make sure you are not CPU starving the region server thread. For example, if you are running a mapreduce job using 6 CPU-intensive tasks on a machine with 4 cores, you are probably starving the region server enough to create longer garbage collection pauses.
  • If you wish to increase the session timeout, add the following to your hbase-site.xml to increase the timeout from the default of 60 seconds to 120 seconds.

 

  <property>
    <name>zookeeper.session.timeout</name>
    <value>1200000</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.tickTime</name>
    <value>6000</value>
  </property>

 

  • Be aware that setting a higher timeout means that the regions served by a failed region server will take at least that amount of time to be transfered to another region server. For a production system serving live requests, we would instead recommend setting it lower than 1 minute and over-provision your cluster in order the lower the memory load on each machines (hence having less garbage to collect per machine).
  • If this is happening during an upload which only happens once (like initially loading all your data into HBase), consider importing into HFiles directly .

  • HBase ships with some GC tuning, for more information see Performance Tuning .

分享到:
评论
1 楼 亦梦亦真 2011-02-09  
  它报的是远程端点不能够连接,和设置这个有什么关系呢?

相关推荐

    面试官:Zookeeper集群怎么搭建?.doc

    "Zookeeper集群搭建" Zookeeper集群是一种分布式应用程序协调服务,用于管理和协调分布式系统中的应用程序。下面是 Zookeeper集群的搭建方式和角色介绍: 一、Zookeeper集群模式 Zookeeper集群有三种搭建方式:...

    第三课:zookeeper 典型使用场景实践1

    在本课程“第三课:Zookeeper典型使用场景实践1”中,主要讨论了Zookeeper在分布式系统中的四个关键应用场景:分布式集群管理、分布式注册中心、分布式JOB和分布式锁。下面是针对这些场景的详细说明: 1. **分布式...

    大数据管理与监控:Ambari:Zookeeper服务配置与监控.docx

    大数据管理与监控:Ambari:Zookeeper服务配置与监控.docx

    大数据管理与监控:Cloudera Manager:Zookeeper服务配置与监控.docx

    大数据管理与监控:Cloudera Manager:Zookeeper服务配置与监控.docx

    读书笔记:ZooKeeper分布式过程协同技术详解.zip

    读书笔记:ZooKeeper分布式过程协同技术详解

    Sre-SOAM-013:Zookeeper安全基线.docx

    Sre-SOAM-013:Zookeeper安全基线

    第二课:zookeeper客户端使用与集群特性.md

    ### 第二课:Zookeeper客户端使用与集群特性详解 #### 一、Zookeeper客户端概述 Zookeeper是一款开源的分布式协调服务框架,它提供了一系列的服务,包括配置维护、域名服务、分布式同步、组服务等。为了方便用户...

    zookeeper-3.4.6-API文档-中文版.zip

    Maven坐标:org.apache.zookeeper:zookeeper:3.4.6; 标签:apache、zookeeper、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,...

    读书笔记:zookeeper分布式过程协同技术详解读书笔记.zip

    读书笔记:zookeeper分布式过程协同技术详解读书笔记

    zookeeper-3.4.9-API文档-中文版.zip

    Maven坐标:org.apache.zookeeper:zookeeper:3.4.9; 标签:apache、zookeeper、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,文档中...

    zookeeper-3.4.10-API文档-中文版.zip

    Maven坐标:org.apache.zookeeper:zookeeper:3.4.10; 标签:apache、zookeeper、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,文档中...

    第一课:zookeeper 特性与节点说明1

    【第一课:Zookeeper特性与节点说明1】 Zookeeper是一个高度可靠的分布式协调系统,它主要解决在分布式环境中多个节点之间的协同工作问题。Zookeeper的主要作用包括但不限于服务注册与发现、配置管理、分布式锁、...

    zookeeper-3.4.14-API文档-中英对照版.zip

    Maven坐标:org.apache.zookeeper:zookeeper:3.4.14; 标签:apache、zookeeper、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,...

    ZKInspector:zookeeper节点管理工具

    **ZKInspector:Zookeeper节点管理工具详解** ZKInspector是一款强大的Zookeeper集群管理工具,专为方便开发者和管理员监控、管理和操作Zookeeper中的数据节点而设计。Zookeeper作为一个分布式协调服务,广泛应用于...

    ZooKeeper 23 道面试题及答案.docx

    "ZooKeeper 面试题及答案" ZooKeeper 是什么? ZooKeeper 是一个分布式的,开放源码的分布式应用程序协调服务,是 Google 的 Chubby 一个开源的实现,它是集群的管理者,监视着集群中各个节点的状态根据节点提交的...

    zookeeper-3.3.3-API文档-中文版.zip

    赠送jar包:zookeeper-3.3.3.jar; 赠送原API文档:zookeeper-3.3.3-javadoc.jar; 赠送源代码:zookeeper-3.3.3-sources.jar; 包含翻译后的API文档:zookeeper-3.3.3-javadoc-API文档-中文(简体)版.zip 对应...

    zookeeper-3.4.6-API文档-中英对照版.zip

    赠送jar包:zookeeper-3.4.6.jar; 赠送原API文档:zookeeper-3.4.6-javadoc.jar; 赠送源代码:zookeeper-3.4.6-sources.jar; 包含翻译后的API文档:zookeeper-3.4.6-javadoc-API文档-中文(简体)-英语-对照版....

    zookeeper系列1:入门

    - **会话(Session)**: 客户端与Zookeeper服务器之间的连接被称为会话。会话期间,服务器会监控客户端的状态,如果客户端长时间无响应,会话将超时并结束。 - **Watcher**: Zookeeper提供了一种观察机制,即...

    第二课:zookeeper客户端使用与集群特性.docx

    ZooKeeper 客户端使用与集群特性 本文将详细介绍 ZooKeeper 客户端的使用和集群特性,包括客户端简介、客户端连接参数说明、客户端 CRUD、客户端监听、集群架构说明、集群配置及参数说明、选举投票机制、主从复制...

    第四十九章:zookeeper分布式协调工具1

    享 的 缓 存 区 , 这 个 缓 存 区 就 是 ZooKeeper。ZooKeeper 在 HDFS HA 中起到了关键作用,它监控 Active 和 Standby NameNode 的状态,并在需要时协助进行主备切换。当 Active NameNode 失效时,ZooKeeper 会...

Global site tag (gtag.js) - Google Analytics