HBase:如何删除区域 [英] HBase: How to delete region

查看:140
本文介绍了HBase:如何删除区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于法律问题,我需要从HBase中删除旧数据.

Due to legal issues I need to delete old data from HBase.

我找到了一种使用我的标准并通过将旧数据移动到新区域来分割区域的方法,但是有没有办法删除该区域?

I found a way to split the region using my criteria and by that moving the old data to the new region, but is there a way to delete that region?

还有其他想法如何实现目标吗?

any other idea how to achieve by goal?

推荐答案

尝试

delete '.META.', 'ROW_FROM_META_WITH_YOUR_TABLE'

如果不确定要删除的行,请对".META"进行扫描.或将其值转储到文件中:

If you are not sure what the row you want to delete run a scan on the ".META." or dump its value into a file:

echo "scan '.META.'"| hbase shell &> dump.txt

然后找到您的行并将其删除.

then find your row and delete it.

由于这会使您的区域出现漏洞",因此请确保运行 hbase hbck PlatformData -repair 来解决这些问题.

Since this will leave your regions with a "hole", make sure you run hbase hbck PlatformData -repair to fix those.

这是一个小的Java代码段,它就是这样做的,并从基础HDFS中删除文件

Here is a small java code snippet that does just that, and deletes files from underlying HDFS.

这篇关于HBase:如何删除区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆