如何扩展hbase命令行超时时间

时间:2017-06-29 22:42:43

标签: hadoop hbase

我正在尝试调试问题,我正在尝试运行手动扫描以确定发生了什么。

然而,似乎有些扫描可以正常工作,但大多数都会因为某种原因而失败。

我们的hbase表中的密钥设置为hash_servername_timestamp,例如

123_servername.domain.com_1234567890.  The hash can run from 0 to 199.

当我跑步时:

  

扫描'server_based_data',{FILTER => “KeyOnlyFilter()AND   (PrefixFilter('0_'))“,COLUMNS =>'raw_data:top',TIMERANGE =>   [1498514400000,1498515000000]}

我返回了一些行:

ROW                                            COLUMN+CELL
 0_app128021.sjc6.mydomain.com_1498514460   column=raw_data:top, timestamp=1498514502321, value=
 0_app128021.sjc6.mydomain.com_1498514580   column=raw_data:top, timestamp=1498514622400, value=
<snip snip>
<snip snip>
 0_app128021.sjc6.mydomain.com_1498514700   column=raw_data:top, timestamp=1498514742839, value=
179 row(s) in 177.4260 seconds

但是,如果我跑:

  

扫描'server_based_data',{FILTER =&gt; “KeyOnlyFilter()AND   (PrefixFilter('1_'))“,COLUMNS =&gt;'raw_data:top',TIMERANGE =&gt;   [1498514400000,1498515000000]}

我收到错误

ROW                                            COLUMN+CELL                                                                                                                          

ERROR: Call id=86, waitTime=60002, operationTimeout=60000 expired.
Here is some help for this command:
Scan a table; pass table name and optionally a dictionary of scanner
specifications.  Scanner specifications may include one or more of:
<snip snip>
<snip snip>

我认为“0_”的作用是因为词典,它是第一个,与“1_”或“199_”相比,但我很困惑为什么“1_”不起作用。有人可以向我解释为什么这不起作用吗?

我还假设如果我增加超时时间,它可能有助于使其工作。有人能告诉我如何从hbase shell增加扫描的超时时间吗?

1 个答案:

答案 0 :(得分:6)

要更改HBase shell的超时时间,您可以使用以下命令hbase.client.operation.timeouthbase.client.scanner.timeout.period

001:0> @shell.hbase.configuration.get("hbase.client.scanner.timeout.period")
=> "60000"
002:0> @shell.hbase.configuration.setInt("hbase.client.scanner.timeout.period", 120000)
003:0> @shell.hbase.configuration.get("hbase.client.scanner.timeout.period")
=> "120000"

或者(不是来自shell),您可以编辑hbase-site.xml中的值,但是要求HBase重新启动群集以注意更改。如:

<property>
 <name>hbase.client.scanner.timeout.period</name>
 <value>120000</value>
</property>