How do I enable compression on an existing HBase table?

I have a very large apdata table of the Hbase table, but it was not set as compressed when it was created. Now it's 1.5TB. So I want to enable the compression feature on this table. I did the following:

(1)disable apData
(2)alter apData,{NAME=>'cf1',COMPRESSION=>'snappy'}
(3)enable 'apData'.

      

But when I use "desc apData"

to view the config it still shows:

COMPRESSION => 'NONE'

Why hasn't this taken effect? How do I shrink the table and also make sure future data is automatically compressed on insert.

Thanks in advance!

+3


source to share


4 answers


You have configured Snappy. Make sure the first instant is loaded on all nodes. To check, please use this command.

hbase org.apache.hadoop.hbase.util.CompressionTest hdfs: // host / path / to / hbase snappy



Once the instant test is successful. The compression mentioned above should work.

More on setting up and installing snappy: http://hbase.apache.org/0.94/book/snappy.compression.html

+3


source


HBase will only compress new HFiles - either new data you write or clump results



+6


source


You need to configure HBase to use Snappy.

You can follow the steps mentioned in the referenced link to enable instant compression in hbase: configure instant compression with HBase

Hope this helps you.

+2


source


We need to configure HBase to use Snappy if we have installed Hadoop and HBase from tarballs; if we installed them from RPM or Debian packages, Snappy does not require HBase configuration.

Depending on the architecture of the machine we are installing, we must add one of the following lines to / etc / hbase / conf / hbase -env.sh:

For 32-bit platforms:
export HBASE_LIBRARY_PATH=/usr/lib/hadoop/lib/native/Linux-i386-32

For 64-bit platforms:
export HBASE_LIBRARY_PATH=/usr/lib/hadoop/lib/native/Linux-amd64-64

      

+1


source







All Articles