在管理节点停止HBase服务并在所有节点安装OmniHBaseGSI全局二级索引软件。集群默认未启用OmniHBaseGSI全局二级索引功能,若使用需手动修改相关配置并重启HBase服务。
1 | /usr/local/hbase/bin/stop-hbase.sh |
1 2 3 4 5 6 | unzip BoostKit-hindex_1.0.0.zip tar -xvf boostkit-hbase-index-1.0.0-aarch64.tar.gz chmod 550 boostkit-hbase-index-1.0.0-aarch64.jar chmod 550 boostkit-hbase-index-client-1.0.0-aarch64.jar cp boostkit-hbase-index-1.0.0-aarch64.jar /usr/local/hbase/lib cp boostkit-hbase-index-client-1.0.0-aarch64.jar /usr/local/hbase/lib |
1 2 3 4 | chmod 750 /usr/local/hbase/conf/ chmod 750 /usr/local/hbase/logs/ chmod 640 /usr/local/hbase/conf/hbase-site.xml chmod 640 /usr/local/hbase/logs/* |
1 | vi /usr/local/hbase/conf/hbase-site.xml
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <property> <name>hbase.coprocessor.master.classes</name> <value>com.huawei.boostkit.hindex.master.GlobalIndexMasterCoprocessor</value> </property> <property> <name>hbase.coprocessor.regionserver.classes</name> <value>com.huawei.boostkit.hindex.regionserver.GlobalIndexRegionServerCoprocessor</value> </property> <property> <name>hbase.coprocessor.region.classes</name> <value>com.huawei.boostkit.hindex.GlobalIndexRegionObserver</value> </property> <property> <name>hbase.client.connection.impl</name> <value>org.apache.hadoop.hbase.client.IndexConnectionImplementation</value> </property> |
参数名称 |
参数值 |
说明 |
---|---|---|
hbase.coprocessor.master.classes |
com.huawei.boostkit.hindex.master.GlobalIndexMasterCoprocessor |
新增HMaster级别协处理器,用于支持索引DDL操作,例如创建索引、删除索引、修改索引状态等功能。 |
hbase.coprocessor.regionserver.classes |
com.huawei.boostkit.hindex.regionserver.GlobalIndexRegionServerCoprocessor |
新增RegionServer级别协处理器,用于管理RegionServer中索引缓存等功能。 |
hbase.coprocessor.region.classes |
com.huawei.boostkit.hindex.GlobalIndexRegionObserver |
新增Region级别协处理器,用于支持修改数据表时同步修改索引表。 |
hbase.client.connection.impl |
org.apache.hadoop.hbase.client.IndexConnectionImplementation |
新增Connection实现类,用于支持拦截scan请求,支持查询索引表进行加速。 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <property> <name>hbase.regionserver.global.index.read.repair.enabled</name> <value>true</value> </property> <property> <name>hbase.regionserver.global.index.row.delete.age.threshold</name> <value>60000</value> </property> <property> <name>hbase.gsi.max.index.count.per.table</name> <value>5</value> </property> <property> <name>hbase.client.max.filter.depth</name> <value>10</value> </property> <property> <name>hbase.client.max.filter.length</name> <value>50</value> </property> |
参数名称 |
参数值 |
说明 |
---|---|---|
hbase.regionserver.global.index.read.repair.enabled |
true |
用于开启OmniHBaseGSI读修复功能,默认值为“false”。建议开启。 |
hbase.regionserver.global.index.row.delete.age.threshold |
60000 |
用于设置索引读修复时,旧数据老化删除时间,默认为1分钟,单位:ms。 |
hbase.gsi.max.index.count.per.table |
5 |
用于设置单个数据表支持创建的索引最大个数,默认值为“5”。 |
hbase.client.max.filter.depth |
10 |
用于设置scan所应用的Filter的最大嵌套深度,默认值为10。此配置用于避免恶意Filter攻击。 |
hbase.client.max.filter.length |
50 |
用于设置scan所应用的Filter的最大长度,默认值为50。此配置用于避免恶意Filter攻击。 |
1 | /usr/local/hbase/bin/start-hbase.sh |