0
votes

Here i have 2 Region server, In which i have created 2 metrics named below with its UID( JAVA byte array).

metrics sys.rack.1: [0, 1, 5]

metrics sys.rack.2: [0, 1, 6]

I need to Pre-split the HBASE "TSDB" table accordingly to share load among the 2 Region servers. http://opentsdb.net/docs/build/html/user_guide/writing.html#pre-split-hbase-regions

HBase will automatically split regions.I want to do the behavior myself by splitting it over the regions.

I have tried but, It initially targets only one regions to write the metrics.At what range could i split the regions ? can any one please help me resolve this.

Edited

Data will be like sys.rack.1 host=20 sys.rack.2 host=18

In tsdb first 3 bytes of metrics are encode as byte array(0,1,5 fr metric 1 and 0,1,6 fr metric2) and used as row key. In HBase we have encoded values with column family and Rowkey.

1
hi karthik, could you give some sample of your data?Whitefret
one thing you could consider is to hash your keys, so your keys will have a wider range. then you just have to split hbase in the hash range (depending on the load)Whitefret
actually Schema will be like this opentsdb.net/docs/build/html/user_guide/backends/hbase.html . Could you please tell me how to hash these kind of keys ?karthik
seing the schema, you would loose the fast query going for hashing. from what I read in tsdb, you will want to split region on metrics so you have one region for each metrics. I don't think you can do better if you want to optmize the reads.Whitefret
While scanning the table it will be like "\x00\x00\x0CW5\x97\x column=t:\xFDL\xFFA, timestamp=1463133487944, value=\x0F\x90\x00\x00\x02\x00\x 07 " encoded value where "t" will be column family. Since am learner in HBase i dont have any idea to resolve region server hot spottingkarthik

1 Answers

1
votes

found out the solution while Creating table in HBase need to presplit by using the below command as per the metrics which we have created in TSDB. for knowing the metrics you scan the TSDB UID table present in the HBase based on that you can split it as below.

create 'tsdb','t',SPLITS => ['\x00\x00\x01', '\x00\x00\x02','\x00\x00\x03', '\x00\x00\x04']

Finally i can able to pre split the tables.