zoukankan      html  css  js  c++  java
  • zookeeper的maxSessionTimeout默认值导致hbase regionserver超时

    zookeeper的maxSessionTimeout默认值导致hbase regionserver超时


    在hbase中经常会遇到regionserver挂掉的情况,查看日志会看到这样的错误信息
    2016-02-16 11:51:24,882 WARN  [master/hadoop02/192.168.100.5:6000] zookeeper.ZKUtil: master:6000-0x3525df55101a556, quorum=hadoop02:2181,hadoop03:2181,hadoop01:2181, baseZNode=/hbase Unable to get data of znode /hbase/xx
    org.apache.zookeeper.KeeperException$SessionExpiredException: KeeperErrorCode = Session expired for /hbase/xx
            at org.apache.zookeeper.KeeperException.create(KeeperException.java:127)
            at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
            at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1155)
            at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.getData(RecoverableZooKeeper.java:359)
            at org.apache.hadoop.hbase.zookeeper.ZKUtil.getData(ZKUtil.java:745)



    说明与zookeeper的连接的session超时了,可是在hbase-site.xml中设置了zookeeper的超时时间为2分钟,原来
    zookeeper中自带两个参数设置了session的超时时间,在启动时日志中会显示
    2016-02-16 11:39:49,164 - INFO  [main:QuorumPeer@992] - tickTime set to 2000
    2016-02-16 11:39:49,165 - INFO  [main:QuorumPeer@1012] - minSessionTimeout set to -1
    2016-02-16 11:39:49,165 - INFO  [main:QuorumPeer@1023] - maxSessionTimeout set to -1


    而minSessionTimeout 和maxSessionTimeout 是用下面的方式算出来的
    public int getMinSessionTimeout()
    { return minSessionTimeout == -1 ? tickTime * 2 : minSessionTimeout; } 
    public int getMaxSessionTimeout() 
    { return maxSessionTimeout == -1 ? tickTime * 20 : maxSessionTimeout; }


    默认情况,tickTime=2sec,那么minSessionTimeout 和 maxSessionTimeout 分别是4sec和40sec


    所以在hbase中设置超时时间是没用的,必须修改zookeeper自身的maxSessionTimeout为1200000,才能真正起到加长zookeeper的session超时时间的作用
  • 相关阅读:
    洛谷 P1498 南蛮图腾
    洛谷 P1538 迎春舞会之数字舞蹈
    洛谷 P1112 波浪数
    洛谷 P1102 A−B数对
    数字量化值Digital Number, 辐射亮度Radiance, 反射率Reflectance,发射率Emissive
    ENVI下基于劈窗算法从MODIS数据中反演海表温度
    ENVI 5.1安装教程
    一些链接
    1、GeometryService计算面积和长度(Calculate_Feature_Length_Or_Area)功能实现
    1、GeometryService的缓冲区(Buffer)功能实现
  • 原文地址:https://www.cnblogs.com/dailidong/p/7571132.html
Copyright © 2011-2022 走看看