Apache HBase HBCK2 工具

HBCK2是 Apache HBase 集群的修复工具。

一. Region信息一致性

一致性是指Region在meta表的信息、Regionserver服务的Region信息和hdfs的Regioninfo的Region信息的一致。

二. HBCK2与hbck1

HBCK2继承自 hbck1,hbck1是 hbase -1.0版本开始附带的修复工具。hbck1不建议运行在 hbase-2.0版本以上的集群 ,它可能会造成一些严重的问题,需使用HBCK2代替 hbck1对 hbase-2.0以上集群进行修复。虽然hbck1仍然捆绑在 hbase-2.0以上的集群中 ,为了尽量减少意外hbck1已被弃用,将在hbase-3.0中删除。hbck1的修复功能 ( -fix) 已被删除,但可以报告 hbase-2.x 集群的状态;hbck1不了解 hbase-2.x 集群内部工作原理,评估的不是很准确。因此,如果你正在使用HBase2.x,那么对HBCK2应该需要了解一些,即使不经常用到。

HBCK2不像以前的hbck1那样工作,即使在两个版本中命令名称相似的情况下也是如此。先来看一下hbck1的命令,我这里是hbase版本是2.4.11hbase hbck -h显示的是:

-----------------------------------------------------------------------
NOTE: As of HBase version 2.0, the hbck tool is significantly changed.
In general, all Read-Only options are supported and can be be used
safely. Most -fix/ -repair options are NOT supported. Please see usage
below for details on which options are not supported.
-----------------------------------------------------------------------

注意:从HBase 2.0版本开始,hbck工具有了较大的改变。一般来说,所有只读的操作都是支持的,并且使用是安全的。很多-fix/ -repair操作不在支持,使用可能会造成一些严重的问题。请参阅下面详细的使用说明不支持哪些选项。

NOTE: Following options are NOT supported as of HBase version 2.0+.

  UNSUPPORTED Metadata Repair options: (expert features, use with caution!)-fix              Try to fix region assignments.  This is for backwards compatiblity-fixAssignments   Try to fix region assignments.  Replaces the old -fix-fixMeta          Try to fix meta problems.  This assumes HDFS region info is good.-fixHdfsHoles     Try to fix region holes in hdfs.-fixHdfsOrphans   Try to fix region dirs with no .regioninfo file in hdfs-fixTableOrphans  Try to fix table dirs with no .tableinfo file in hdfs (online mode only)-fixHdfsOverlaps  Try to fix region overlaps in hdfs.-maxMerge <n>     When fixing region overlaps, allow at most <n> regions to merge. (n=5 by default)-sidelineBigOverlaps  When fixing region overlaps, allow to sideline big overlaps-maxOverlapsToSideline <n>  When fixing region overlaps, allow at most <n> regions to sideline per group. (n=2 by default)-fixSplitParents  Try to force offline split parents to be online.-removeParents    Try to offline and sideline lingering parents and keep daughter regions.-fixEmptyMetaCells  Try to fix hbase:meta entries not referencing any region (empty REGIONINFO_QUALIFIER rows)UNSUPPORTED Metadata Repair shortcuts-repair           Shortcut for -fixAssignments -fixMeta -fixHdfsHoles -fixHdfsOrphans -fixHdfsOverlaps -fixVersionFile -sidelineBigOverlaps -fixReferenceFiles-fixHFileLinks-repairHoles      Shortcut for -fixAssignments -fixMeta -fixHdfsHoles

在hbase2中,hbck的命令是不支持修复的,需要使用hbck2命令,后面会介绍。

三. Hbck1 一致性的检查和修复命令

一致性检查命令

hbase hbck <-details> <表名>
hbase hbck -details portrait:test1

一致性修复

hbase hbck <-fixMeta> ,<-fixAssignments> <表名>

命令详解

-fixMeta:Try to fix meta problems.  This assumes HDFS region info is good.

主要以hdfs为准进行修复,hdfs存在则添加到meta中,不存在删除meta对应region。

-fixAssignments:Try to fix region assignments.  Replaces the old -fix

不同情况,动作不一样,包括下线、关闭和重新上线

四. 构建和运行Hbck2

HBCK2每次运行时都会执行一个独立的任务,但并不影响HBCK2分析正在运行的集群,然后像hbck1那样修复所有问题。

HBCK2是用来修复的正在运行的集群中的不一致或堵塞Region。可以查看正在运行的集群 Master 的日志和Web UI,一旦发现问题就可以使用HBCK2工具进行修复或跳过不良状态。必须在HBase Master节点上进行修复,而不是在修复工具的本地进行修复,这是HBCK2和hbck1的另一个重要区别。

1. 获取HBCK2

HBCK2已经被剥离出HBase成为了一个单独的项目,如果你想要使用这个工具,需要根据自己HBase的版本,编译源码。

其GitHub地址为:https://github.com/apache/hbase-operator-tools.git

hbase-operator-tools/pom.xml中将hbase版本换成当前HBase版本,项目根目录下运行打包命令:

mvn clean install -DskipTests

打包完成后,是有多个jar包的,将自己需要的hbck2取出来hbase-operator-tools/hbase-hbck2/target/hbase-hbck2-1.0.0-SNAPSHOT.jar

2. 运行Hback2

hbase-hbck2-1.3.0-SNAPSHOT.jar不是胖jar,运行时需要提供依赖;向HBCK2提供其依赖的最简单方法是通过$HBASE_HOME/bin/hbase脚本来启动HBCK2。hbase脚本本身就提供了hbck操作,默认情况下试运行的hbck1工具;运行hbck2 需要指定jar包路径-j /path/to/HBCK2.jar。可以使用的hbase -h查看帮助文档。

${HBASE_HOME}/bin/hbase --config /etc/hbase-conf hbck -j ~/hbase-operator-tools/hbase-hbck2/target/hbase-hbck2-1.0.0-SNAPSHOT.jarhbase --config /usr/hbase-2.4.11/conf hbck -j /root/zhongyk/hbase-hbck2-1.3.0-SNAPSHOT.jar

/etc/hbase-conf是hbase部署的配置所在目录。HBCK2的jar在~/hbase-operator-tools/hbase-hbck2/target/hbase-hbck2-1.0.0-SNAPSHOT.jar。上述命令没有传递任何选项或参数将输出HBCK2命令的帮助文档:

usage: HBCK2 [OPTIONS] COMMAND <ARGS>
Options:-d,--debug                                       run with debug output-h,--help                                        output this help message-p,--hbase.zookeeper.property.clientPort <arg>   port of hbase ensemble-q,--hbase.zookeeper.quorum <arg>                hbase ensemble-s,--skip                                        skip hbase version check(PleaseHoldException)-v,--version                                     this hbck2 version-z,--zookeeper.znode.parent <arg>                parent znode of hbaseensemble......

五.HBCK2概述

HBCK2目前是一个简单的工具,一次只做一件事。

在hbase-2.x中,Master是所有状态的最终决定者,所以大多数HBCK2命令原则是要求Master实现对hbase进行修复。这意味着在你运行HBCK2命令之前,Master必须已经启动。

HBCK2的实现方法是利用Master的HbckService服务,该服务发布了一些方法供HBCK2工具使用。因此,HBCK2依赖Master的HbckService服务,HBCK2做的第一件事是探查集群以确保服务是可用的。如果HbckService服务没有启动或者缺乏所需的方法,这将会失败。

HBCK2应该能够跨多个hbase-2.x版本工作。如果它无法运行,就会输出异常信息。在2.0.3至2.1.1的hbase版本中没有HbckService,HBCK2不能在这些版本中运行。对于这种种情况,如果你可以请更新你的集群以获得更多的修复工具。

命令使用示例:

#cd /usr/hbase-2.4.11/bin
# 运行Hback2
hbase --config /usr/hbase-2.4.11/conf hbck -j /root/zhongyk/hbase-hbck2-1.3.0-SNAPSHOT.jar
# 当hbase:meta中缺少region,但目录仍然存在于HDFS中时使用,报告meta中缺少region
hbase --config  /usr/hbase-2.4.11/conf hbck -j ~/zhongyk/hbase-hbck2-1.3.0-SNAPSHOT.jar reportMissingRegionsInMeta portrait:user_portrait
#当hbase:meta中缺少region,但目录仍然存在于HDFS中时使用,重新将有效region的添加到meta中。
hbase --config  /usr/hbase-2.4.11/conf hbck -j ~/zhongyk/hbase-hbck2-1.3.0-SNAPSHOT.jar addFsRegionsMissingInMeta portrait:user_portrait
# 当hbase:meta上存在的区域,但HDFS没有相关的目录时使用。-f 通过删除所有发现的额外区域来修复元数据。
hbase --config  /usr/hbase-2.4.11/conf hbck -j ~/zhongyk/hbase-hbck2-1.3.0-SNAPSHOT.jar extraRegionsInMeta -f portrait:user_portrait
# 修Region的状态
hbase --config  /usr/hbase-2.4.11/conf hbck -j ~/zhongyk/hbase-hbck2-1.3.0-SNAPSHOT.jar setRegionState 7b54c3ba927f4a5dbca62464d7893958 OPEN

更多操作可参考:https://blog.csdn.net/wolf_333/article/details/118854634

翻译笔记(后续整理):

usage: HBCK2 [OPTIONS] COMMAND <ARGS>
Options:-d,--debug                                       run with debug outputdebug方式运行-h,--help                                        output this help message查看帮助文档-p,--hbase.zookeeper.property.clientPort <arg>   port of hbase ensemblehbase集群端口-q,--hbase.zookeeper.quorum <arg>                hbase ensemblehbase的IP或主机名-s,--skip                                        skip hbase version check(PleaseHoldException)跳过hbase版本检查-v,--version                                     this hbck2 version查看hbck2的版本-z,--zookeeper.znode.parent <arg>                parent znode of hbaseensemble
Command:addFsRegionsMissingInMeta <NAMESPACE|NAMESPACE:TABLENAME>...|-i <INPUT_FILE>...Options:-i,--inputFiles  take one or more files of namespace or table names接收一个或多个表名空间的输入文件 当hbase:meta缺少regions,但HDFS目录仍然存在regions的数据。如果用户运行hbck1对hbase-2.x的集群会发生'OfflineMetaRepair'。需要hbase:meta在线。为每一个表名作为参数传递,执行可用的regions修复hbase:meta和HDFS region目录的差异。To be used when regions missing from hbase:meta but directoriesare present still in HDFS. Can happen if user has run _hbck1_'OfflineMetaRepair' against an hbase-2.x cluster. Needs hbase:metato be online. For each table name passed as parameter, performs diffbetween regions available in hbase:meta and region dirs on HDFS.Then for dirs with no hbase:meta matches, it reads the 'regioninfo'metadata file and re-creates given region in hbase:meta. Regions arere-created in 'CLOSED' state in the hbase:meta table, but not in theMasters' cache, and they are not assigned either. To get theseregions online, run the HBCK2 'assigns'command printed when thiscommand-run completes.当hbase:meta中缺少区域,但目录仍在HDFS中时,可以使用。但在HDFS中仍然存在。如果用户对hbase-2.x运行了_hbck1_ 'OfflineMetaRepair'对hbase-2.x集群。需要hbase:meta 是在线的。对于每一个作为参数传递的表名,在hbase:meta中可用的区域之间执行差异 中的区域和 HDFS 上的区域目录之间的差异。然后对于没有hbase:meta匹配的目录,它读取'regioninfo'的 元数据文件并在hbase:meta中重新创建指定的区域。区域被 重新创建的区域在hbase:meta表中处于 "关闭 "状态,但不在master缓存中。Master'缓存中,而且它们也没有被分配。为了让这些 区域,在这个命令运行完成后,运行HBCK2的'assigns'命令。命令运行完成后打印出来。NOTE: If using hbase releases older than 2.3.0, a rolling restart ofHMasters is needed prior to executing the set of 'assigns' output.An example adding missing regions for tables 'tbl_1' in the defaultnamespace, 'tbl_2' in namespace 'n1' and for all tables fromnamespace 'n2':注意:如果使用比2.3.0更早的hbase版本,在执行'assigns'输出之前,需要滚动重启HMasters 在执行这组'assigns'输出之前,需要滚动重启HMasters。一个例子:为默认命名空间中的表'tbl_1'添加缺失区域,命名空间'n1'中的'tbl_2'以及命名空间'n2'中的所有表。$ HBCK2 addFsRegionsMissingInMeta default:tbl_1 n1:tbl_2 n2Returns HBCK2  an 'assigns' command with all re-inserted regions.If -i or --inputFiles is specified, pass one or more input file names.Each file contains <NAMESPACE|NAMESPACE:TABLENAME>, one per line. For example:返回HBCK2的'assigns'命令,包括所有重新插入的区域。如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<NAMESPACE|NAMESPACE:TABLENAME>,每行一个。例如。For example:$ HBCK2 addFsRegionsMissingInMeta -i fileName1 fileName2SEE ALSO: reportMissingRegionsInMeta另见SEE ALSO: fixMeta另见assigns [OPTIONS] <ENCODED_REGIONNAME/INPUTFILES_FOR_REGIONNAMES>...Options:-o,--override  override ownership by another procedure覆盖-i,--inputFiles  take one or more encoded region namesA 'raw' assign that can be used even during Master initialization (ifthe -skip flag is specified). Skirts Coprocessors. Pass one or moreencoded region names. 1588230740 is the hard-coded name for thehbase:meta region and de00010733901a05f5a2a3a382e27dd4 is an example ofwhat a user-space encoded region name looks like. For example:取一个或多个编码的区域名称 一个 "原始 "赋值,即使在Master初始化过程中也可以使用(如果指定了 指定了-skip标志)。裙边协处理器。传递一个或多个 编码的区域名称。1588230740是硬编码的名称,用于 hbase:meta区域的硬编码名称,de00010733901a05f5a2a3a382e27dd4是一个用户空间编码区域名称的例子。用户空间编码的区域名称是什么样子的。比如说$ HBCK2 assigns 1588230740 de00010733901a05f5a2a3a382e27dd4Returns the pid(s) of the created AssignProcedure(s) or -1 if none.返回创建的AssignProcedure的pid,如果没有则返回-1。If -i or --inputFiles is specified, pass one or more input file names.如果指定了-i或-inputFiles,传递一个或多个输入文件名。Each file contains encoded region names, one per line. For example:每个文件包含编码的区域名称,每行一个。比如说。$ HBCK2 assigns -i fileName1 fileName2bypass [OPTIONS] <PID>...Options:-o,--override   override if procedure is running/stuck如果程序正在运行/停滞,则重写-r,--recursive  bypass parent and its children. SLOW! EXPENSIVE!绕过父节点及其子节点。绕过父体和其子体。缓慢! 费钱!-w,--lockWait   milliseconds to wait before giving up; default=1在放弃之前等待的毫秒数;默认=1-i,--inputFiles  take one or more input files of PIDsPass one (or more) procedure 'pid's to skip to procedure finish. Parentof bypassed procedure will also be skipped to the finish. Entities willbe left in an inconsistent state and will require manual fixup. Mayneed Master restart to clear locks still held. Bypass fails ifprocedure has children. Add 'recursive' if all you have is a parent pidto finish parent and children. This is SLOW, and dangerous so useselectively. Does not always work.接受一个或多个PID的输入文件 传递一个(或多个)程序'pid',以跳过程序完成。父程序 的父程序也将被跳过到程序结束。实体将 处于不一致的状态,需要手动修复。可能 需要主程序重启以清除仍然持有的锁。旁路失败,如果 程序有子程序。如果你只有一个父程序的pid,请添加 "递归"。来完成父程序和子程序。这很慢,而且很危险,所以要 选择性地使用。并不总是有效。If -i or --inputFiles is specified, pass one or more input file names.Each file contains PID's, one per line. For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含PID,每行一个。比如说。$ HBCK2 bypass -i fileName1 fileName2extraRegionsInMeta <NAMESPACE|NAMESPACE:TABLENAME>...|-i <INPUT_FILE>...Options:-f, --fix    fix meta by removing all extra regions found.通过删除所有发现的额外区域来修复元数据。-i,--inputFiles  take one or more input files of namespace or table names接收一个或多个输入文件,Reports regions present on hbase:meta, but with no relateddirectories on the file system. Needs hbase:meta to be online.For each table name passed as parameter, performs diffbetween regions available in hbase:meta and region dirs on the givenfile system. Extra regions would get deleted from Metaif passed the --fix option.这些文件包括hbase:meta上的命名空间或表名报告区域,但在文件系统中没有相关的目录。需要hbase:meta在线。或者每个表名作为参数传递,在hbase:meta中的区域和给定的区域目录之间进行差分。在hbase:meta中可用的区域和给定文件系统中的区域目录之间进行差异。文件系统上的区域。额外的区域将被从Meta中删除 中删除,如果通过-fix选项的话。报告在hbase:meta上存在的区域,但在文件系统中没有相关的目录。需要hbase:meta在线。或者每一个作为参数传递的表名,在hbase:meta中的区域和给定的区域目录之间进行diff 在hbase:meta中的区域和给定文件系统中的区域目录之间进行差异。文件系统中的区域。额外的区域将被从Meta中删除 中删除,如果通过-fix选项的话。NOTE: Before deciding on use the "--fix" option, it's worth check ifreported extra regions are overlapping with existing valid regions.If so, then "extraRegionsInMeta --fix" is indeed the optimal solution.Otherwise, "assigns" command is the simpler solution, as it recreatesregions dirs in the filesystem, if not existing.注意:在决定使用"-fix "选项之前,值得检查一下报告的额外区域是否与现有的有效区域重叠。如果是,那么 "extraRegionsInMeta --fix "确实是最佳解决方案。否则,"assigns "命令是更简单的解决方案,因为它在文件系统中重新创建了 如果不存在,它将在文件系统中重新创建区域目录。An example triggering extra regions report for tables 'table_1'and 'table_2', under default namespace:一个在默认命名空间下触发表 "table_1 "和 "table_2 "的额外区域报告的例子。$ HBCK2 extraRegionsInMeta default:table_1 default:table_2An example triggering extra regions report for table 'table_1'under default namespace, and for all tables from namespace 'ns1':触发表 "table_1 "的额外区域报告的一个例子 和来自命名空间'ns1'的所有表。$ HBCK2 extraRegionsInMeta default:table_1 ns1Returns list of extra regions for each table passed as parameter, orfor each table on namespaces specified as parameter.返回作为参数传递的每个表的额外区域列表,或者作为参数指定的命名空间上的每个表If -i or --inputFiles is specified, pass one or more input file names.Each file contains <NAMESPACE|NAMESPACE:TABLENAME>, one per line. For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<NAMESPACE|NAMESPACE:TABLENAME>,每行一个。比如说。$ HBCK2 extraRegionsInMeta -i fileName1 fileName2filesystem [OPTIONS] [<TABLENAME>...|-i <INPUT_FILE>...]Options:-f, --fix    sideline corrupt hfiles, bad links, and references.副线腐败的hfiles,坏的链接,和参考资料。-i,--inputFiles  take one or more input files of table namesReport on corrupt hfiles, references, broken links, and integrity.Pass '--fix' to sideline corrupt files and links. '--fix' does NOTfix integrity issues; i.e. 'holes' or 'orphan' regions. Pass one ormore tablenames to narrow checkup. Default checks all tables andrestores 'hbase.version' if missing. Interacts with the filesystemonly! Modified regions need to be reopened to pick-up changes.取一个或多个表名的输入文件 报告损坏的hfiles、引用、断裂的链接和完整性。通过'--fix'来排查损坏的文件和链接。--fix "并不 修复完整性问题;即 "洞 "或 "孤儿 "区域。通过一个或多个 多个tablenames来缩小检查范围。默认检查所有的表并 如果缺失,则恢复 "hbase.version"。与文件系统交互 仅仅是! 修改过的区域需要重新打开以获取变化。If -i or --inputFiles is specified, pass one or more input file names.Each file contains <TABLENAME>, one per line. For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<TABLENAME>,每行一个。比如说。$ HBCK2 extraRegionsInMeta -i fileName1 fileName2fixMetaDo a server-side fix of bad or inconsistent state in hbase:meta.Available in hbase 2.2.1/2.1.6 or newer versions. Master UI hasmatching, new 'HBCK Report' tab that dumps reports generated bymost recent run of _catalogjanitor_ and a new 'HBCK Chore'. Itis critical that hbase:meta first be made healthy before makingany other repairs. Fixes 'holes', 'overlaps', etc., creating(empty) region directories in HDFS to match regions added tohbase:meta. Command is NOT the same as the old _hbck1_ commandnamed similarily. Works against the reports generated by the lastcatalog_janitor and hbck chore runs. If nothing to fix, run is anoop. Otherwise, if 'HBCK Report' UI reports problems, a run offixMeta will clear up hbase:meta issues. See 'HBase HBCK' UIfor how to generate new report.对hbase:meta中的不良或不一致的状态做一个服务器端的修复。在hbase 2.2.1/2.1.6或更新的版本中可用。主界面有 匹配,新的 "HBCK报告 "选项卡可以转储由_catalogjanitor最近一次运行产生的报告。新的 "HBCK报告 "选项卡,它可以转储由_catalogjanitor_最近一次运行产生的报告和新的 "HBCK任务"。这一点 在进行任何其他修复之前,首先要使hbase:meta变得健康,这是至关重要的。任何其他的修复。修复了 "漏洞"、"重叠 "等问题,在HBCK中创建了 (空的)区域目录,以匹配添加到HDFS中的区域。hbase:meta。该命令与以前的_hbck1_命令不一样。名称相似。对上一个_hbck1_命令所产生的报告起作用。catalog_janitor 和 hbck chore 运行产生的报告。如果没有什么可修复的,运行是一个 noop。否则,如果 "HBCK报告 "的用户界面报告了问题,运行一次 fixMeta将清除hbase:meta问题。参见 "HBase HBCK "用户界面 以了解如何生成新的报告。SEE ALSO: reportMissingRegionsInMetagenerateMissingTableDescriptorFile <TABLENAME>Trying to fix an orphan table by generating a missing table descriptorfile. This command will have no effect if the table folder is missingor if the .tableinfo is present (we don't override existing tabledescriptors). This command will first check it the TableDescriptor iscached in HBase Master in which case it will recover the .tableinfoaccordingly. If TableDescriptor is not cached in master then it willcreate a default .tableinfo file with the following items:试图通过生成一个丢失的表描述符来修复一个无主表 文件。如果表文件夹丢失,或者.tableinfo存在,这个命令就没有效果。或.tableinfo是存在的(我们不会覆盖现有的表 描述符)。该命令将首先检查TableDescriptor是否被 缓存在HBase Master中,在这种情况下,它将恢复.tableinfo 相应地恢复。如果TableDescriptor没有被缓存在主数据库中,那么它将会 创建一个默认的.tableinfo文件,其中包括以下项目:- the table name表的名称- the column family list determined based on the file system基于文件系统确定的列族列表- the default properties for both TableDescriptor andColumnFamilyDescriptors表描述符和列族描述符的默认属性。列家族描述符的默认属性If the .tableinfo file was generated using default parameters thenmake sure you check the table / column family properties later (andchange them if needed).如果.tableinfo文件是使用默认参数生成的,那么请确保你以后检查表/列族属性(并且 如果需要的话,可以改变它们)This method does not change anything in HBase, only writes the new.tableinfo file to the file system. Orphan tables can cause e.g.ServerCrashProcedures to stuck, you might need to fix these stillafter you generated the missing table info files.这个方法不会改变HBase中的任何东西,只是将新的  .tableinfo文件到文件系统。孤儿表可能会导致例如 孤岛表可能会导致例如ServerCrashProcedures卡住,你可能还需要在生成了缺失的表信息文件后修复这些表。在你生成了缺失的表信息文件之后,你可能还需要解决这些问题。replication [OPTIONS] [<TABLENAME>...|-i <INPUT_FILE>...]Options:-f, --fix    fix any replication issues found.修复任何发现的复制问题。-i,--inputFiles  take one or more input files of table namesLooks for undeleted replication queues and deletes them if passed the'--fix' option. Pass a table name to check for replication barrier andpurge if '--fix'.接受一个或多个表名的输入文件 寻找未删除的复制队列,如果通过'-fix'选项,则删除它们。'-fix'选项,则删除它们。传递一个表名来检查复制障碍并 清除,如果'-fix'的话If -i or --inputFiles is specified, pass one or more input file names.Each file contains <TABLENAME>, one per line. For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<TABLENAME>,每行一个。比如说。$ HBCK2 replication -i fileName1 fileName2reportMissingRegionsInMeta <NAMESPACE|NAMESPACE:TABLENAME>...|-i <INPUT_FILE>...Options:-i,--inputFiles  take one or more input files of namespace or table names接受一个或多个名称空间或表名的输入文件To be used when regions missing from hbase:meta but directoriesare present still in HDFS. Can happen if user has run _hbck1_'OfflineMetaRepair' against an hbase-2.x cluster. This is a CHECK onlymethod, designed for reporting purposes and doesn't perform anyfixes, providing a view of which regions (if any) would get re-addedto hbase:meta, grouped by respective table/namespace. To effectivelyre-add regions in meta, run addFsRegionsMissingInMeta.用于hbase:meta中缺少的区域,但目录仍在HDFS中。但仍存在于HDFS中。如果用户对hbase-2.x运行了_hbck1_ 'OfflineMetaRepair'对hbase-2.x集群。这是一个仅有的CHECK 方法,为报告目的而设计,不执行任何 修复,提供一个视图,显示哪些区域(如果有的话)会被重新添加到 到hbase:meta中,按照各自的表/命名空间分组。为了有效地 重新添加区域到meta中,运行addFsRegionsMissingInMeta。This command needs hbase:meta to be online. For each namespace/tablepassed as parameter, it performs a diff between regions available inhbase:meta against existing regions dirs on HDFS. Region dirs with nomatches are printed grouped under its related table name. Tables withno missing regions will show a 'no missing regions' message. If nonamespace or table is specified, it will verify all existing regions.It accepts a combination of multiple namespace and tables. Table namesshould include the namespace portion, even for tables in the defaultnamespace, otherwise it will assume as a namespace value.这个命令需要hbase:meta是在线的。对于每个作为参数传递的命名空间/表 的参数,它都会在hbase:meta中的区域与HDFS上现有的区域目录之间进行比较。hbase:meta中的区域与HDFS上现有的区域目录进行比较。没有匹配的区域目录 匹配的区域目录会被打印出来,归入其相关的表名下。有 的表会显示一个 "没有丢失的区域 "的信息。如果没有 名称空间或表被指定,它将验证所有现有的区域。它接受多个命名空间和表的组合。表的名称 应该包括命名空间部分,即使是默认的 名称空间的表,否则它将假定为一个名称空间值。An example triggering missing regions report for tables 'table_1'and 'table_2', under default namespace:触发表'table_1'和'table_2'的缺失区域报告的例子,在默认命名空间下。$ HBCK2 reportMissingRegionsInMeta default:table_1 default:table_2An example triggering missing regions report for table 'table_1'under default namespace, and for all tables from namespace 'ns1':触发表 "table_1 "的缺失区域报告的一个例子 和来自命名空间'ns1'的所有表。$ HBCK2 reportMissingRegionsInMeta default:table_1 ns1Returns list of missing regions for each table passed as parameter, orfor each table on namespaces specified as parameter.返回作为参数传递的每个表的缺失区域的列表,或 对于作为参数指定的命名空间上的每个表。If -i or --inputFiles is specified, pass one or more input file names.Each file contains <NAMESPACE|NAMESPACE:TABLENAME>, one per line. For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<NAMESPACE|NAMESPACE:TABLENAME>,每行一个。比如说。$ HBCK2 reportMissingRegionsInMeta -i fileName1 fileName2setRegionState [<ENCODED_REGIONNAME> <STATE>|-i <INPUT_FILE>...]Options:-i,--inputFiles  take one or more input files of encoded region names and states接受一个或多个编码区域名称和状态的输入文件Possible region states:可能的区域状态OFFLINE, OPENING, OPEN, CLOSING, CLOSED, SPLITTING, SPLIT,FAILED_OPEN, FAILED_CLOSE, MERGING, MERGED, SPLITTING_NEW,MERGING_NEW, ABNORMALLY_CLOSEDWARNING: This is a very risky option intended for use as last resort.Example scenarios include unassigns/assigns that can't move forwardbecause region is in an inconsistent state in 'hbase:meta'. Forexample, the 'unassigns' command can only proceed if passed a regionin one of the following states: SPLITTING|SPLIT|MERGING|OPEN|CLOSINGBefore manually setting a region state with this command, pleasecertify that this region is not being handled by a running procedure,such as 'assign' or 'split'. You can get a view of running proceduresin the hbase shell using the 'list_procedures' command. An examplesetting region 'de00010733901a05f5a2a3a382e27dd4' to CLOSING:这是一个非常有风险的选项,旨在作为最后手段使用。例子包括取消分配/分配不能前进 因为区域在'hbase:meta'中处于不一致的状态。例如 例如,'unassigns'命令只有在通过一个区域时才能进行 处于以下状态之一时才能进行。分割|分裂|合并|打开|关闭 在用这个命令手动设置一个区域的状态之前,请 证明该区域没有被运行中的程序处理。例如 "分配 "或 "分割"。你可以在hbase shell中使用 "assign "或 "split "来查看正在运行的程序 你可以使用'list_procedures'命令在hbase shell中查看正在运行的过程。一个例子 设置区域'de00010733901a05f5a2a3a382e27dd4'为关闭状态。$ HBCK2 setRegionState de00010733901a05f5a2a3a382e27dd4 CLOSINGReturns "0" if region state changed and "1" otherwise.如果区域状态改变,返回 "0",否则返回 "1"。If -i or --inputFiles is specified, pass one or more input file names.Each file contains <ENCODED_REGIONNAME> <STATE>, one pair per line.For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<ENCODED_REGIONNAME><STATE>,每行一对。比如说。$ HBCK2 setRegionState -i fileName1 fileName2setTableState [<TABLENAME> <STATE>|-i <INPUT_FILE>...]Options:-i,--inputFiles  take one or more input files of table names and statesPossible table states: ENABLED, DISABLED, DISABLING, ENABLINGTo read current table state, in the hbase shell run:接受一个或多个表名和状态的输入文件 可能的表状态。enabled, disabled, disabling, enabling 要读取当前表的状态,在hbase shell中运行hbase> get 'hbase:meta', '<TABLENAME>', 'table:state'A value of \x08\x00 == ENABLED, \x08\x01 == DISABLED, etc.Can also run a 'describe "<TABLENAME>"' at the shell prompt.An example making table name 'user' ENABLED:一个值为\x08\x00 == ENABLED,\x08\x01 == DISABLED,等等。也可以在shell提示下运行'describe "<TABLENAME>"'。一个例子是使表名 "user "成为ENABLED。$ HBCK2 setTableState users ENABLEDReturns whatever the previous table state was.If -i or --inputFiles is specified, pass one or more input file names.Each file contains <TABLENAME> <STATE>, one pair per line.For example:返回上一个表的状态是什么。如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<TABLENAME> <STATE>,每行一对。比如说。$ HBCK2 setTableState -i fileName1 fileName2scheduleRecoveries <SERVERNAME>...|-i <INPUT_FILE>...Options:-i,--inputFiles  take one or more input files of server namesSchedule ServerCrashProcedure(SCP) for list of RegionServers. Formatserver name as '<HOSTNAME>,<PORT>,<STARTCODE>' (See HBase UI/logs).Example using RegionServer 'a.example.org,29100,1540348649479':接受一个或多个服务器名称的输入文件 为 RegionServers 列表安排服务器崩溃程序(SCP)。格式 服务器名称为'<HOSTNAME>,<PORT>,<STARTCODE>'(参见HBase UI/logs)。例如使用RegionServer'a.example.org,29100,1540348649479'。$ HBCK2 scheduleRecoveries a.example.org,29100,1540348649479Returns the pid(s) of the created ServerCrashProcedure(s) or -1 ifno procedure created (see master logs for why not).返回已创建的ServerCrashProcedure的pid,如果没有创建,则返回-1。则返回-1,如果没有创建任何程序(见主日志中的原因)。Command support added in hbase versions 2.0.3, 2.1.2, 2.2.0 or newer.在hbase 2.0.3, 2.1.2, 2.2.0或更新的版本中增加了命令支持。If -i or --inputFiles is specified, pass one or more input file names.Each file contains <SERVERNAME>, one per line. For example:如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含<SERVERNAME>,每行一个。例如。$ HBCK2 scheduleRecoveries -i fileName1 fileName2unassigns <ENCODED_REGIONNAME>...|-i <INPUT_FILE>...Options:-o,--override  override ownership by another procedure覆盖另一个程序的所有权-i,--inputFiles  take one or more input files of encoded names接受一个或多个编码名称的输入文件A 'raw' unassign that can be used even during Master initialization(if the -skip flag is specified). Skirts Coprocessors. Pass one ormore encoded region names. 1588230740 is the hard-coded name for thehbase:meta region and de00010733901a05f5a2a3a382e27dd4 is an exampleof what a userspace encoded region name looks like. For example:一个 "原始的 "取消赋值,甚至可以在Master初始化期间使用(如果指定了-skip标志)。裙边协处理器。传递一个或多个编码的区域名称。1588230740是hbase:meta区域的硬编码名称,de00010733901a05f5a2a3a382e27dd4是一个用户空间编码区域名称的例子。例如。$ HBCK2 unassign 1588230740 de00010733901a05f5a2a3a382e27dd4Returns the pid(s) of the created UnassignProcedure(s) or -1 if none.If -i or --inputFiles is specified, pass one or more input file names.Each file contains encoded region names, one per line. For example:返回创建的UnassignProcedure的pid,如果没有则返回-1。如果指定了-i或-inputFiles,传递一个或多个输入文件名。每个文件包含编码的区域名称,每行一个。比如说$ HBCK2 unassigns fileName1 -i fileName2SEE ALSO, org.apache.hbase.hbck1.OfflineMetaRepair, the offlinehbase:meta tool. See the HBCK2 README for how to use.

HBase集群修复工具HBCK2相关推荐

  1. HBase集群升级, 通过HBase rpm 或 tar包形式(以HDP 为例,包含 升级及HBCK2 介绍和使用)

    目录 1 前言 2 编译 HBase 报错处理: `Caused by: java.lang.AbstractMethodError: org.apache.hadoop.hbase.ipc.RpcS ...

  2. HBase 2.0之修复工具HBCK2,修复数据

    1.起因 此次修复数据情况是:服务器中毒导致HBASE异常关闭, 启动各种错误,实在没搞懂就清理了ZK关于HBASE的目录(rmr /hbase 建议先看原因,实在不行在做这个删除ZK操作,不对任何人 ...

  3. 云HBase小组成功抢救某公司自建HBase集群,挽救30+T数据

    摘要: 使用过开源HBase的人都知道,运维HBase是多么复杂的事情,集群大的时候,读写压力大,配置稍微不合理一点,就可能会出现集群状态不一致的情况,糟糕一点的直接导致入库.查询某个业务表不可用, ...

  4. 转载:云HBase小组成功抢救某公司自建HBase集群,挽救30+T数据

    概述 使用过开源HBase的人都知道,运维HBase是多么复杂的事情,集群大的时候,读写压力大,配置稍微不合理一点,就可能会出现集群状态不一致的情况,糟糕一点的直接导致入库.查询某个业务表不可用, 甚 ...

  5. Java客户端访问HBase集群解决方案(优化)

    测试环境:Idea+Windows10 准备工作: <1>.打开本地 C:\Windows\System32\drivers\etc(系统默认)下名为hosts的系统文件,如果提示当前用户 ...

  6. 用 Ganglia 监控基于 Biginsights 的 HBase 集群性能

    2019独角兽企业重金招聘Python工程师标准>>> BigInsights 和 HBase 简介 InfoSphere BigInsights 是 IBM 集成和开发的一个大数据 ...

  7. hbase集群之间数据迁移_hbase数据迁移到另一集群上

    通常我们都会有将hbase表数据迁到另一个hbase表中业务需要,这种不要着急,我选择一种最适合的方式,因为每种方式处理的数据量.对集群的压力都是有差异的 总的划分可以分为命令行和API两种方式,本人 ...

  8. 如何构建 HBase 集群监控系统?

    2019独角兽企业重金招聘Python工程师标准>>> 公司有自己的监控系统,我们所要做的就是将 HBase 中我们关心的指标项发送到监控系统去,问题就转换为我们开发,采集并返回哪些 ...

  9. Redis 集群搭建及集群管理工具

    目录 一.简介 二.架构图 三.搭建集群 3.1.下载 3.2.编译安装 3.3.配置文件修改 3.4.创建集群 四.集群管理工具redis-cli 4.1.查看集群信息 4.2.检查集群 4.3.修 ...

最新文章

  1. oracle取得序列当前值(不改变当前序列值)
  2. 【Python】编程笔记4
  3. C# 8 新增小功能
  4. springmvc学习笔记--mybatis--使用插件自动生成实体和mapper
  5. bootstrap实现表格
  6. Liferay7 BPM门户开发之24: Liferay7应用程序安全
  7. pandas小记:pandas数据规整化-缺失、冗余、替换
  8. 模拟退火算法之旅行商(TSP)问题matlab实现
  9. Mybatis框架|Mybatis下载步骤
  10. ZEMAX 2018中文版光学仿真视频教程
  11. 计算机安全模式无法启动,电脑无法启动,电脑安全模式进不去解决方法大全?...
  12. sw如何缩放装配体_SolidWorks大装配体技巧
  13. (转)如何将Sklearn数据集Bunch格式转换为Pandas数据集DataFrame?
  14. 连接数据库失败,难道MySQL 5.7客户端与8.0数据库不兼容?
  15. mysql 字段被截断_msyql存储数据时字段被截断
  16. 开学季好物怎么选,学生党必备的几款好物分享
  17. CentOS8设置笔记本合盖不休眠
  18. 【JokerのLabView】程序结构。
  19. easyExcel 实现不同对象写入到同一个sheet中
  20. 基于Android实现之智慧记单词APP【100011028】

热门文章

  1. 学习方法阶段性复盘分享
  2. 【渝粤题库】国家开放大学2021春2727税收基础题目
  3. 区块链溯源:让教育更加公正、透明,让人民更有保障
  4. ?? php语法,PHP基本语法汇总
  5. Fiddler手机抓包https失败解决方案
  6. lgv30屏幕参数_性能升级 LG V30 真旗舰 835+曲面屏
  7. 自己搭建了一个美团外卖红包的公众号
  8. Postgresql BRIN索引
  9. Hbuilder X mui 华为真机运行和调试 (Java本地后台接口)
  10. 递归方程的求解(代入、递归树和主方法)