HBae找不到协处理器导致RegionServer全部挂掉

关于HBase协处理器导致问题的研究 1 加载协处理器 1.1 将协处理器上传到hdfs: hadoop fs -mkdir /hbasenew/usercoprocesser hadoop fs -ls /hbasenew/usercoprocesser hadoop fs -rm /hbasenew/usercoprocesser/coprocessor.jar hadoop fs -copyFromLocal /hom 阅读详情

一、问题背景:

    跟兄弟单位公用一个大数据集群,通过Dataspace结合Kerberos控制数据的访问,我们生产环境中用到的OLAP工具Kylin,在升级Kylin的过程中,由于删除了旧的协处理器,导致原来数据继续去寻找目标协处理器,找不到引起所有RegionServer退出,始终想不明白hbase有关协处理器的机制,于是查找资料才得以清楚。


一下内容为转载,原地址:http://blog.itpub.net/12129601/viewspace-1690668/     主要用于个人收藏、备查。转载请注明原作者。

二、协处理的使用

1 加载协处理器
1.1 将协处理器上传到hdfs:
hadoop fs -mkdir /hbasenew/usercoprocesser
hadoop fs -ls /hbasenew/usercoprocesser
hadoop fs -rm /hbasenew/usercoprocesser/coprocessor.jar
hadoop fs -copyFromLocal /home/hbase/coprocessor.jar  /hbasenew/usercoprocessor
1.2 将协处理器加载到表中:
1)先卸载协处理器:
disable 'ns_bigdata:tb_test_coprocesser'
alter 'ns_bigdata:tb_test_coprocesser',METHOD => 'table_att_unset',NAME =>'coprocessor$1'
enable 'ns_bigdata:tb_test_coprocesser'
2)再加载协处理器:
disable 'ns_bigdata:tb_test_coprocesser'
alter 'ns_bigdata:tb_test_coprocesser',METHOD => 'table_att','coprocessor' => '/hbasenew/usercoprocesser/coprocessor.jar|com.suning.hbase.coprocessor.service.HelloWorldEndPoin|1001|'
enable 'ns_bigdata:tb_test_coprocesser'
注意:在加载协处理器是我特意将协处理器中的类名少写一个字母t,以重现将集群regionserver搞挂的现象以及表的状态不一致的现象。

2 出现的问题
以上操作会导致如下两个问题:
2.1 将集群的region server搞挂掉

2.2 将加载协处理器的表的状态搞的不一致,一直处于enabling状态

对表做disable和enable操作均不可操作:

同时此表对应的regionserver上出现如下错误:

3 原因分析
3.1 关于协处理加载错误导致regionserver挂掉的原因分析
在hbase的源码中,参数:hbase.coprocessor.abortonerror的默认值是true:
public static final String ABORT_ON_ERROR_KEY = "hbase.coprocessor.abortonerror";
  public static final boolean DEFAULT_ABORT_ON_ERROR = true;
下面查看此参数的含义:

      hbase.coprocessor.abortonerror
      true
      Set to true to cause the hosting server (master or regionserver)
      to abort if a coprocessor fails to load, fails to initialize, or throws an
      unexpected Throwable object. Setting this to false will allow the server to
      continue execution but the system wide state of the coprocessor in question
      will become inconsistent as it will be properly executing in only a subset
      of servers, so this is most useful for debugging only. 
因此,当加载错误的协处理器之后,会导致regionserver挂掉。

3.2 关于加载协处理器的表的状态不一致的原因分析:
相关错误日志:

查看enable的相关源码:
public void enableTable(final TableName tableName)
  throws IOException {
    enableTableAsync(tableName);

    // Wait until all regions are enabled
    waitUntilTableIsEnabled(tableName);

    LOG.info("Enabled table " + tableName);
  }
private void waitUntilTableIsEnabled(final TableName tableName) throws IOException {
    boolean enabled = false;
    long start = EnvironmentEdgeManager.currentTimeMillis();
    for (int tries = 0; tries < (this.numRetries * this.retryLongerMultiplier); tries++) {
      try {
        enabled = isTableEnabled(tableName);
      } catch (TableNotFoundException tnfe) {
        // wait for table to be created
        enabled = false;
      }
      enabled = enabled && isTableAvailable(tableName);
      if (enabled) {
        break;
      }
      long sleep = getPauseTime(tries);
      if (LOG.isDebugEnabled()) {
        LOG.debug("Sleeping= " + sleep + "ms, waiting for all regions to be " +
          "enabled in " + tableName);
      }
      try {
        Thread.sleep(sleep);
      } catch (InterruptedException e) {
        // Do this conversion rather than let it out because do not want to
        // change the method signature.
        throw (InterruptedIOException)new InterruptedIOException("Interrupted").initCause(e);
      }
    }
    if (!enabled) {
      long msec = EnvironmentEdgeManager.currentTimeMillis() - start;
      throw new IOException("Table '" + tableName +
        "' not yet enabled, after " + msec + "ms.");
    }
  }

===========================================================================
  /**
   * Brings a table on-line (enables it).  Method returns immediately though
   * enable of table may take some time to complete, especially if the table
   * is large (All regions are opened as part of enabling process).  Check
   * {@link #isTableEnabled(byte[])} to learn when table is fully online.  If
   * table is taking too long to online, check server logs.
   * @param tableName
   * @throws IOException
   * @since 0.90.0
   */
  public void enableTableAsync(final TableName tableName)
  throws IOException {
    TableName.isLegalFullyQualifiedTableName(tableName.getName());
    executeCallable(new MasterCallable(getConnection()) {
      @Override
      public Void call() throws ServiceException {
        LOG.info("Started enable of " + tableName);
        EnableTableRequest req = RequestConverter.buildEnableTableRequest(tableName);
        master.enableTable(null,req);
        return null;
      }
    });
  }
发现在enable的过程中,首先是执行enable操作,操作完毕后需要等待各个regionserver反馈所有region的状态,由于此时regionserver已经挂掉,一直在连接重试等待,此时表的状态一直是ENABLING。

4 问题的处理
4.1 关于regionserver 挂掉的问题处理:
通过在hbase-site.xml文件中设置参数:
    
    hbase.coprocessor.abortonerror
    false
    
并启动region server可以解决,这样就忽略了协处理器出现的错误,保证集群高可用。
4.2 关于有协处理器的表的状态不一致,不能disable和enable问题的解决办法:
此问题可以通过切换master节点可以解决,将主停掉,backup-master会承担主master的任务,同时在切换的过程中,会将状态不一致的表的状态改为一致的:

切换后的master信息如下:

在切换的过程中调用了如下方法:
  /**
   * Recover the tables that are not fully moved to ENABLED state. These tables
   * are in ENABLING state when the master restarted/switched
   *
   * @throws KeeperException
   * @throws org.apache.hadoop.hbase.TableNotFoundException
   * @throws IOException
   */
  private void recoverTableInEnablingState()
      throws KeeperException, TableNotFoundException, IOException {
    Set enablingTables = ZKTable.getEnablingTables(watcher);
    if (enablingTables.size() != 0) {
      for (TableName tableName : enablingTables) {
        // Recover by calling EnableTableHandler
        LOG.info("The table " + tableName
            + " is in ENABLING state.  Hence recovering by moving the table"
            + " to ENABLED state.");
        // enableTable in sync way during master startup,
        // no need to invoke coprocessor
        EnableTableHandler eth = new EnableTableHandler(this.server, tableName,
          catalogTracker, this, tableLockManager, true);
        try {
          eth.prepare();
        } catch (TableNotFoundException e) {
          LOG.warn("Table " + tableName + " not found in hbase:meta to recover.");
          continue;
        }
        eth.process();
      }
    }
  }
在却换过程中,跟踪master和对应的regionserver的后台日志:
master日志:
其中的部分日志信息如下:
2015-05-20 10:00:01,398 INFO  [master:nim-pre:60000] master.AssignmentManager: The table ns_bigdata:tb_test_coprocesser is in ENABLING state.  Hence recovering by moving the table to ENABLED state.
2015-05-20 10:00:01,421 DEBUG [master:nim-pre:60000] lock.ZKInterProcessLockBase: Acquired a lock for /hbasen/table-lock/ns_bigdata:tb_test_coprocesser/write-master:600000000000002
2015-05-20 10:00:01,436 INFO  [master:nim-pre:60000] handler.EnableTableHandler: Attempting to enable the table ns_bigdata:tb_test_coprocesser
2015-05-20 10:00:01,465 INFO  [master:nim-pre:60000] handler.EnableTableHandler: Table 'ns_bigdata:tb_test_coprocesser' has 1 regions, of which 1 are offline.
2015-05-20 10:00:01,466 INFO  [master:nim-pre:60000] balancer.BaseLoadBalancer: Reassigned 1 regions. 1 retained the pre-restart assignment.
2015-05-20 10:00:01,466 INFO  [master:nim-pre:60000] handler.EnableTableHandler: Bulk assigning 1 region(s) across 3 server(s), retainAssignment=true
对应的regionserver的日志如下:
2015-05-20 14:39:56,175 INFO  [master:sup02-pre:60000] master.AssignmentManager: The table ns_bigdata:tb_test_coprocesser is in ENABLING state.  Hence recovering by moving the table to ENABLED state.
2015-05-20 14:39:56,211 DEBUG [master:sup02-pre:60000] lock.ZKInterProcessLockBase: Acquired a lock for /hbasen/table-lock/ns_bigdata:tb_test_coprocesser/write-master:600000000000031
2015-05-20 14:39:56,235 INFO  [master:sup02-pre:60000] handler.EnableTableHandler: Attempting to enable the table ns_bigdata:tb_test_coprocesser
2015-05-20 14:39:56,269 INFO  [master:sup02-pre:60000] handler.EnableTableHandler: Table 'ns_bigdata:tb_test_coprocesser' has 1 regions, of which 1 are offline.
2015-05-20 14:39:56,270 INFO  [master:sup02-pre:60000] balancer.BaseLoadBalancer: Reassigned 1 regions. 1 retained the pre-restart assignment.
2015-05-20 14:39:56,270 INFO  [master:sup02-pre:60000] handler.EnableTableHandler: Bulk assigning 1 region(s) across 3 server(s), retainAssignment=true

结论:
1. 为了提高集群的高可用性,应该将参数:hbase.coprocessor.abortonerror设置为true,这样即使加载的协处理器有问题,也不会导致集群的regionserver挂掉,也不会导致表不能enable和disable;
2.即使表出现不能enable和disable的现象后,也可以通过切换master来解决,因此在搭建集群时,一定要至少有一到两个backupmaster

5 全部master节点宕后集群的读写测试
1. 在集群都是正常的情况下,通过客户端往集群中插入2000000行数据,插入正常
2.将集群的所有master全部停掉:

3.监控客户端的数据插入情况,发现客户端的数据插入正常。持续让客户端继续插入20000000行数据,发现数据插入正常。
4.在客户端批量读取数据,发现数据读取正常。
结论:当hbase集群的master所有节点挂掉后(一定时间段,目前测试的是半小时内),客户端的数据读写正常。

kylin-3.0.1 安装踩坑 基于hadoop3.1 + hbase2.0 下载 https://mirror.bit.edu.cn/apache/kylin/apache-kylin-3.0.1/apache-kylin-3.0.1-bin-hadoop3.tar.gz 上传至服务器并解压 配置环境变量 vim /etc/profile.d/kylin.sh export KYLIN_HOME=/usr/local/apache-kylin-3.0.... 阅读详情

相关推荐

HBase Table Enabling issue

有的时候HBase的表在enable的过程中出现问题,导致最终状态处于中间状态,而这个时候客户端又没有办法使用这个表。这里分析一下一个case envhbase 0.98.0.2.1.3.7-18-hadoop2 版本比较老Issue如下的表的状态就处于中间状态hbase(main):011:0> is_enabled 'prod_eglesprk_tasks' false 0 row(s) in

心中永远的正能量 3401

hbase协处理器引发的问题解决方案

因协处理器涉及不当导致regionserver停工,没法启动,可以先在配置文件hbase-site.xml文件中将hbase.coprocessor.abortonerror设为false。让hbase继续启动,但此事你无法见协处理器卸载,若要将其卸载,需创建backup-master,创建方法为,新建配置文件:backupmasters,在此文件中键入backup -master的hostname

小白菜 3330

不用Root!这些隐藏代码能一键开启安卓诊断端口(小米/OPPO/魅族机型实测)

本文提供了一份无需Root权限即可开启安卓手机诊断端口的实用指南。通过拨号盘输入特定隐藏代码,小米、OPPO、魅族等机型的用户可以一键激活此工程模式,从而连接电脑进行基带数据备份(如QCN文件)或故障排查。文章详细列出了各品牌指令、操作验证步骤,并强调了备份IMEI等关键数据的重要性与操作风险,旨在帮助用户在紧急情况下修复网络问题。

weixin_29260291的博客 275

Hadoop源码分析5: RPC基本线程

1. 数据记录FileStatus public class FileStatus implements Writable { private String filename; private long time; static { // register IPCFileStatus WritableFactories.setFac...

weixin_30764771的博客 333

模糊综合评价模型

一.引子 1.数学归纳法:同高中知识 2.秃子悖论:秃子悖论 这俩个例子都是类似于“量变引起质变”的道理,而在数学中我们把这类问题的性质叫做“模糊性”,在生活中我们也经常能遇到一些模糊的概念,比如年轻、帅、很少很多… 二.概述 模糊综合评价法是一种基于模糊数学的综合评价方法。该综合评价法根据模糊数学的隶属度理论把定性评价转化为定量评价,即用模糊数学对受到多种因素制约的事物或对象做出一个总体的评价。它具有结果清晰,系统性强的特点,能较好地解决模糊的、难以量化的问题,适合各种非确定性问题的解决。——来自百度百

The__Tyche的博客 2万+

告别ArcGIS小红叉:从‘无法验证登录信息’到成功连接在线资源的完整排错记录

本文详细记录了从Windows便签的网络错误到ArcGIS连接问题的完整排错过程。通过分析代理服务器、DNS配置和系统网络设置,解决了ArcGIS无法验证登录信息的问题,提供了实用的网络优化方案和技术排错思路。

weixin_26800111的博客 391

Kylin 在贝壳找房的实践及 HBase 优化

近期Apache Kylin Meetup上,贝壳找房高级研发工程师冯亮分享了Kylin在贝壳找房的实践,从性能调优上向大家介绍如何通过对 HBase 的优化来保障重点业务的查询性能,实...

Focus on Lakehouse 542

rk3576之imx415 4k@60fps

1;0;1;0;1;0;1;0;1;0;1;0;1;0;

darennet的专栏 705

abortonerror_关于HBase协处理器导致问题的研究

1 加载协处理器1.1 将协处理器上传到hdfs:hadoop fs -mkdir /hbasenew/usercoprocesserhadoop fs -ls /hbasenew/usercoprocesserhadoop fs -rm /hbasenew/usercoprocesser/coprocessor.jarhadoop fs -copyFromLocal /home/hbase/co...

weixin_39574140的博客 509

2021电子科技大学分布式系统期末考点精析与实战解析

本文深入解析2021年电子科技大学分布式系统期末考试核心考点,包括分布式事务、时钟同步、GFS架构等高频内容。基于回忆版试题,提供实战解析与应试技巧,帮助考生高效复习。重点涵盖两阶段提交、Cristian算法等关键技术,适合计算机专业学生备考参考。

weixin_29251131的博客 543

H3C交换机命令大全,分模块好记忆!

在深入命令之前,我们先来了解H3C交换机的命令行基础。<H3C>[H3C]常用基础命令如下:这些基础命令是操作H3C交换机的敲门砖,熟练掌握后,我们将按模块深入探讨更具体的配置命令。H3C交换机的命令可以按功能模块分类,包括系统管理、接口配置、VLAN操作、链路聚合、路由配置、安全管理等。

网络技术联盟站 784

hbase regionserver挂掉的问题

之前regionserver老挂,今天终于找到原因了。 是程序中一个函数不停的构造HTable。导致消耗内存。导致gc full。 这篇文章中得到提示:http://www.cnblogs.com/panfeng412/archive/2012/07/11/htable-and-htablepool-apply-notes.html   HTable使用时的一些注意事项: 1.   规避...

weixin_34014555的博客 256

【ROS2】机械臂MoveIt2

navigation2 专注于移动机器人的导航与定位,处理大范围空间的底盘运动;MoveIt2 专注于机械臂的操作规划,处理多关节协同的末端执行器运动。在复合机器人(如,移动机械臂)navigation2 负责移动到目标区域,MoveIt2 负责机械臂抓取。官网:https://moveit.picknik.ai/main/index.html。

郭老二 602

java.lang.RuntimeException: HRegionServer Aborted

hbase在命令行使用的时候突然全部挂掉,报出错误: java.lang.RuntimeException: HRegionServer Aborted 重新启动,马上又挂掉,想起刚刚添加了一个Coprocessor,原来默认当加载错误的协处理器之后,会导致regionserver挂掉 修改配置文件添加       hbase.coprocessor.abortonerror   

数据技术控 6403

使用ChatGPT工具阅读文献的实战教程

本文介绍核心内容为使用ChatGPT工具阅读文献,希望对学习和使用ChatGPT的同学们有所帮助。为了兼顾质量和速度,本专栏的更新频率为一周一到两更。 文章目录 1. 前言 2. 实战教程 2.1 下载工具并登录 2.2 提取文献中的关键信息

herosunly的博客 15万+

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

hbase 2.1.5利用协处理器同步新增数据到ES填坑记录

1.hbase-site.xml配置文件必须添加<property> <name>hbase.coprocessor.abortonerror</name> <value>false</value> </property>,防止因协处理器启动失败,导致regionServer挂掉,从而导致hbase崩溃。 2.一定要实现R...

lieying411 618

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

HBase-错误记录

1. windows远程开发HBase提示:java.net.UnknownHostException: unknown host: master 解决方案: C:\WINDOWS\system32\drivers\etc\hosts中添加 IP1 hostName1 IP2 hostName2 IP3 hostName3 2. 在将HBase添加协处理器时,出现错误 ERR...

Nobigo 6538

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

coprocessor

添加 *disable'emp' *alter'emp',METHOD=>'table_att','coprocessor'=>'hdfs://mycluster:8020/ldstest/coprocess.jar|com.test.coprocessor.Pla...

chenla5762的博客 216

记一次hbase procedure.DisableTableProcedure: Not ENABLED, state=ENABLING, skipping disable; pid=128898

给一个表添加协处理器导致生产hbase集群挂掉重启之后出现rit问题,刺激!

南风知我意 785

maven导入项目出现的几个问题及HRegionServer Aborted异常处理

啥也不说了,以后编译出现问题就找这几个地方吧 还有一个问题: hbase在命令行使用的时候突然全部挂掉,查看日志: java.lang.RuntimeException: HRegionServer Aborted 重新启动,马上又挂掉,想起刚刚添加了一个Coprocessor,原来默认当加载错误的协处理器之后,会导致regionserver挂掉 修改配置文件添加 hbase.coproc...

孙大迪迪的博客 1030

HBase基本概念

转自:http://www.bcmeng.com/hbase-basic/ HBase是什么 HBase构建在 HDFS 之上的分布式列式键值存储系统。HBase内部管理的文件全部存储在HDFS中。 HBase VS HDFS HDFS适合批处理场景 不支持数据随机查找 不适合增量数据处理 不支持数据更新 HBase VS RDBMS 范式化和反范...

210
上一篇: HBase 配置详解
下一篇: Mysql的高可用方案及主从详细配置
Ronney-Hua
博客等级 码龄10年 48粉丝 74原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值