Hbase-put调优

问题:

数据put一直报 table=daas:unicom_stat, attempt=11/35 failed=8ops, last exception: org.apache.hadoop.hbase.RegionTooBusyException: org.apache.hadoop.hbase.RegionTooBusyException: StoreTooBusy,daas:unicom_stat,1_47EA07A87638CD2F_2019-02-09_02,1555906135085.0cb7e9e40084f6118f21037379dcda96.:item Above parallelPutToStoreThreadLimit(10) ,

解析一下任务报错信息: 表daas:unicom_stat,region 1_47EA07A87638CD2F_2019-02-09_02,1555906135085.0cb7e9e40084f6118f21037379dcda96.且cf是item的RegionTooBusyException异常

然后我们来看源码


for (Map.Entry<byte[], List<Cell>> e : familyMaps.entrySet()) {
      Store store = this.region.getStore(e.getKey());
      if (store == null || e.getValue() == null) {
        continue;
      }
     // 如果当前cell的列大小超过默认值(100列),则继续
      if (e.getValue().size() > this.parallelPutToStoreThreadLimitCheckMinColumnCount) {
​
        //we need to try to add #preparePutCount at first because preparePutToStoreMap will be
        //cleared when changing the configuration.
        preparePutToStoreMap.putIfAbsent(e.getKey(), new AtomicInteger());
        AtomicInteger preparePutCounter = preparePutToStoreMap.get(e.getKey());
        if (preparePutCounter == null) {
          preparePutCounter = new AtomicInteger();
          preparePutToStoreMap.putIfAbsent(e.getKey(), preparePutCounter);
        }
        int preparePutCount = preparePutCounter.incrementAndGet();
        // 如果当前region的某个storefile的并行put线程数超过10个,则进行异常捕获前的变量赋值,即获取regionname,cf等信息
        if (store.getCurrentParallelPutCount() > this.parallelPutToStoreThreadLimit
            || preparePutCount > this.parallelPreparePutToStoreThreadLimit) {
          tooBusyStore = (tooBusyStore == null ?
              store.getColumnFamilyName() :
              tooBusyStore + "," + store.getColumnFamilyName());
        }
​
        if (LOG.isTraceEnabled()) {
          LOG.trace(store.getColumnFamilyName() + ": preparePutCount=" + preparePutCount
              + "; currentParallelPutCount=" + store.getCurrentParallelPutCount());
        }
      }
    }
    //tooBusyStore此变量不为空则抛异常
    if (tooBusyStore != null) {
      String msg =
          "StoreTooBusy," + this.region.getRegionInfo().getRegionNameAsString() + ":" + tooBusyStore
              + " Above parallelPutToStoreThreadLimit(" + this.parallelPutToStoreThreadLimit + ")";
      if (LOG.isTraceEnabled()) {
        LOG.trace(msg);
      }
      throw new RegionTooBusyException(msg);
    }


所以很明显是由列数过多或者并行put线程数过多而引起的,这里是由于表字段太多,设置一下put时的列数>源表的列数即可(源表有200字段)

转载于:https://my.oschina.net/lzhaoqiang/blog/3064067

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值