hbase删除region块的脚本

删除hbase表region块脚本

  1. 文件hua.txt格式:
  2. CHAT_INFO,1318153079100530000314050,1318173760068.991ca04ff164c3f7987a9d93e0f744f5.
  3. CHAT_INFO,1318156265075530000260366,1318173760068.2e9ac5a34869209f95ab46bf72061fd6.
  4. CHAT_INFO,1318158690100530000063285,1318176690151.dfe4ec67087d58daa1d15e014fa3bbf0.
  5. deleteregioninmeta.sh删除hdfs的region以及.META.表中的region信息,内容如下:
  6. !#/bin/bash
  7. while read line
  8. do
  9. #        echo "$line"
  10. regionpath=/hbase/$1/`echo "$line" | awk -F ‘.‘ ‘{print $2}‘`
  11. echo "$regionpath"
  12. hadoop fs -mv  $regionpath /hua/chat_info_bak
  13. echo "deleteall ‘.META.‘,‘$line‘" | hbase shell
  14. done < $2
  15. 执行命令:sh deleteregioninmeta.sh CHAT_INFO  /home/hadoop/hua/hua.txt

复制代码

时间: 2024-08-29 12:58:56

hbase删除region块的脚本的相关文章

删除hbase的region步骤和代码

1.初始化hbase连接 1 Configuration conf = HbaseCommonsUnit.initConfiguration(); 2 Connection conn = ConnectionFactory.createConnection(conf); 3 Table meta_table = conn.getTable(TableName.META_TABLE_NAME); 4 HTable table = new HTable(conf, Bytes.toBytes(tab

Hbase的region合并与拆分详解

1.region 拆分机制 region中存储的是大量的rowkey数据 ,当region中的数据条数过多的时候,直接影响查询效率.当region过大的时候.hbase会拆分region , 这也是Hbase的一个优点 . HBase的region split策略一共有以下几种: 1.ConstantSizeRegionSplitPolicy 0.94版本前默认切分策略 当region大小大于某个阈值(hbase.hregion.max.filesize=10G)之后就会触发切分,一个regio

[HBase]ERROR: Region is not online

重启HBase后,进入hbase shell 进行 scan .get .create等操作均报错: ERROR: org.apache.hadoop.hbase.NotServingRegionException: org.apache.hadoop.hbase.NotServingRegionException: Region is not online: .META.,,1at org.apache.hadoop.hbase.regionserver.HRegionServer.getRe

HBase,region以及HFile概念

HBase的region的概念,在逻辑上和table是1:1的关系:但是region在物理实现上对应的是HFile,于是就存在一个region的分割的逻辑,其实似乎region的物理实现HFile的分割. 那么HFile的分割之后数据是一分为二了,那么未来向HFile中插入数据的时候怎么知道向那个HFile中插入呢?其实每个HFile都会有自己的startRowKey以及endRowKey:被一分为二的HFile在META表中会被重新分配startRowKey以及endRowKey信息:这个两个

[转载]Shell删除各种注释的脚本

转自:http://www.cppblog.com/zhangyq/archive/2010/10/08/127915.html 1.txt内容:file content  aabbcc<<<comment part 1abcdefghilkdifdfdfmmmmmmmmeeeeeeeeeeeeee  comment part 2>>>  ddeeffsed -e ":begin; /<<</,/>>>/ { />&g

异常-Phoenix HBASE Last region should end with an empty key. You need to create a new region and regioninfo in HDFS to plug the hole

1 详细异常信息 RROR: There is a hole in the region chain between \x03\x00\x00\x00\x00\x00\x00\x00\x00 and \x05\x00\x00\x00\x00\x00\x00\x00\x00. You need to create a new .regioninfo and region dir in hdfs to plug the hole. ERROR: There is a hole in the regi

HBase解决Region Server Compact过程占用大量网络出口带宽的问题

HBase 0.92版本之后,RegionServer的Compact过程根据待合并的文件大小分为smallcompaction和large compaction两种,由此可能导致在集群写入量大的时候Compact占用过多的网络出口带宽.本文将详细描述集群使用过程中遇到这一问题的排查过程及其解决方法. 1. 发现问题 HBase集群(版本为0.94.0)运行过程中,发现5台Region Server的网络出口带宽经常维持在100MB/s以上,接近到网卡的极限:同时Region Server的机器

JQuery 关于复制或者删除html块

1.复制当前ul var content = $("#" + id).closest("ul").clone(true); content.find("a").replaceWith('<a class="red pl5" name="Delete" href="#">删除</a>'); content.find(".nameNum").htm

思路:如何快速写一个全面的数据库 增备+全备+删除,自动化的脚本?

1.数据作用: 数据对我们来说是非常非常的重要,如果你是管理数据员.运维人员的,数据丢失了,找不回来,也就意味着,你的职业生涯就结束了,为了避免数据丢失,我们也做了很多的维护.备份,比如做主从复制.做全备.增备等等.这个可以参考我的另一篇文章Mysql主从复制. 我这里就不多说,今天我们要怎么写一个比较好的数据备份自动化脚本,让我们更好的管理数据库. 2.mysql备份脚本思路 首先要有一个思路,我的要求是每个的周一到周五做增量备份,周六做全备,对前两天的增备的日志删除,对两个星期前的全备也进行