HBase 区域 - 区域服务器编程分配
HBase region - region server programmatic assignment
假设我有 100 个 HBase
节点和几个 tables A, B, C
,它们的键前面加上 000:099 前缀.表是根据前缀创建的,因此每个 table 有 100 个区域。
我想为所有行分配前缀:
000
至 node-00
、
001
到 node-01
,
- 等等。
想法是在同一台机器上保存具有相同前缀的数据,因为我的典型场景是处理table A,转换数据并将其放入table B,然后处理table B几次,做一些转换和聚合。
我没有在 docs 中看到说明,需要一些关于如何继续的建议。
您可以创建一个新的 table 需要的地区数量。然后在使用 move 命令填充 table 之前进行手动区域平衡,将区域放入所需的服务器。查看帮助
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。
假设我有 100 个 HBase
节点和几个 tables A, B, C
,它们的键前面加上 000:099 前缀.表是根据前缀创建的,因此每个 table 有 100 个区域。
我想为所有行分配前缀:
000
至node-00
、001
到node-01
,- 等等。
想法是在同一台机器上保存具有相同前缀的数据,因为我的典型场景是处理table A,转换数据并将其放入table B,然后处理table B几次,做一些转换和聚合。
我没有在 docs 中看到说明,需要一些关于如何继续的建议。
您可以创建一个新的 table 需要的地区数量。然后在使用 move 命令填充 table 之前进行手动区域平衡,将区域放入所需的服务器。查看帮助
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。