测试hbase预设分区

测试hbase预设分区

 

phonex-4.3 hbase-0.98.10

环境 hbase-0.98.10,hadoop-2.5.2 
预设分区使用hbase为了在写入阶段避免个别节点过热,通过数据的分布图,在创建表的时候预设表的分区:

create 'test_splits', {NAME => 'cf', VERSIONS=> 3},{SPLITS => ['a','b','c']}

设置hbase-site.xml

<property>
    <name>hbase.hregion.max.filesize</name>
    <value>3145728</value>
</property>
<property> 
        <name>hbase.hregion.memstore.flush.size</name> 
        <value>1048576</value> 
</property>
<property>
        <name>hbase.hstore.compactionThreshold</name> 
        <value>3</value> 
</property>

设置hfile为3M,memstore为1M,当storefile的个数等于3的时候,出发合并

手动循环导入数据;

测试结果: 
等超过hfile大小后依然采取自动分裂来达到集群平衡,如果避免自动分裂,可以设置filesize的值为足够大,默认10G,比如设置为100G,然后在合适的时间段手动出发分裂

猜你喜欢

转载自duguyiren3476.iteye.com/blog/2200064