HBase区域 - 区域服务器程序分配

时间:2017-03-28 22:05:12

标签: java hbase

假设我有100个HBase个节点和几个表A, B, C,其中的键前面带有 000:099 前缀。使用基于前缀的拆分创建表,因此每个表有100个区域。

我想为所有行分配前缀:

  • 000node-00
  • 001node-01
  • 等等。

我们的想法是在同一台机器上保存具有相同前缀的数据,因为我的典型场景是处理表A ,转换数据并将其放入表B ,然后多次处理表B 进行一些转换和聚合。

我没有看到docs中的说明,需要一些有关如何继续的建议。

1 个答案:

答案 0 :(得分:1)

您可以创建一个需要区域数量的新表格。然后在使用 move 命令填充表之前执行手动区域平衡,将区域放入所需的服务器。请参阅帮助

hbase(main):004:0> help move

Here is some help for this command:
Move a region.  Optionally specify target regionserver else we choose one
at random.  NOTE: You pass the encoded region name, not the region name so
this command is a little different to the others.  The encoded region name
is the hash suffix on region names: e.g. if the region name were
TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396. then
the encoded region name portion is 527db22f95c8a9e0116f0cc13c680396
A server name is its host, port plus startcode. For example:
host187.example.com,60020,1289493121758
Examples:

  hbase> move 'ENCODED_REGIONNAME'
  hbase> move 'ENCODED_REGIONNAME', 'SERVER_NAME'

或者您可以尝试使用HBaseAdmin执行此操作,请参阅方法move

相关问题