Configure the blocksize for a column family

You can configure the blocksize of a column family at table creation or by disabling and altering an existing table.

These instructions are valid whether or not you use Cloudera Manager to manage your cluster.

To configure the blocksize for a column family:

  1. In the HBase shell, type:
    hbase> create ‘test_table′,{NAME => ‘test_cf′, BLOCKSIZE => '262144'}
    hbase> disable 'test_table'
    hbase> alter 'test_table', {NAME => 'test_cf', BLOCKSIZE => '524288'}
    hbase> enable 'test_table'
    After changing the blocksize, the HFiles will be rewritten during the next major compaction.
  2. To trigger a major compaction, issue the following command in HBase Shell:
    hbase> major_compact 'test_table'
    Depending on the size of the table, the major compaction can take some time and have a performance impact while it is running.
  3. To view the blocksize metrics, see the block_cache* entries in the RegionServer metrics section in the HBase web user interface.