18

大家好,我在大表上运行 phoenix count 查询时收到以下错误消息。

0: jdbc:phoenix:hadoopm1:2181> select Count(*) from PJM_DATASET;
+------------+
|  COUNT(1)  |
+------------+

java.lang.RuntimeException: org.apache.phoenix.exception.PhoenixIOException: org.apache.phoenix.exception.PhoenixIOException: Failed after attempts=36, exceptions:
Fri Jan 09 02:18:10 CST 2015, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=62365: row '' on table 'PJM_DATASET' at region=PJM_DATASET,,1420633295836.4394a3aa2721f87f3e6216d20ebeec44., hostname=hadoopctrl,60020,1420790733247, seqNum=27753

    at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2440)
    at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2074)
    at sqlline.SqlLine.print(SqlLine.java:1735)
    at sqlline.SqlLine$Commands.execute(SqlLine.java:3683)
    at sqlline.SqlLine$Commands.sql(SqlLine.java:3584)
    at sqlline.SqlLine.dispatch(SqlLine.java:821)
    at sqlline.SqlLine.begin(SqlLine.java:699)
    at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:441)
    at sqlline.SqlLine.main(SqlLine.java:424)
0: jdbc:phoenix:hadoopm1:2181>

请帮忙。

4

4 回答 4

1

您需要在 hbase 服务器和客户端配置中将以下 hbase 配置属性增加到更高的值,默认值为 1 分钟(60000 毫秒)

  <property>
    <name>hbase.rpc.timeout</name>
    <value>600000</value>
  </property>

最重要的是,下面的命令应该返回正确的 hbase 配置目录,其中 hbase-site.xml 文件包含上述属性。如果 hbase_conf_path 的值为空或 .,则export HADOOP_CONF_DIR=<correct_hbase_dir>;在执行命令前执行指向正确 hbase 配置的命令sqlline.py

phoenix_utils.py  | grep hbase_conf_path
于 2015-11-25T17:20:52.247 回答
1

(原始问题三年后)

我们今天遇到了非常相似的异常:

java.net.SocketTimeoutException: callTimeout=60000, callDuration=60101: row '' on table '****' at region=****, hostname=wn1-bghbas.y1ao3ht4safu3e4em4fhuri0eh.ax.internal.cloudapp.net,16020,1543844388080, seqNum=568644
org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Mon Dec 03 14:01:45 UTC 2018, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=60101: row '' on table '****' at region=****, hostname=****, seqNum=568644

       at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:271)
       at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:210)
       at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
       at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:210)
       at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:327)
       at org.apache.hadoop.hbase.client.ClientScanner.loadCache(ClientScanner.java:413)
       at org.apache.hadoop.hbase.client.ClientScanner.next(ClientScanner.java:371)
       at org.apache.phoenix.iterate.ScanningResultIterator.next(ScanningResultIterator.java:55)
       ... 11 more

在跟踪异常的调用跟踪后,我们发现正确的配置变量是hbase.client.scanner.timeout.period. 其中可以在类 org.apache.hadoop.hbase.HConstants名下找到HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD

请注意,如果您将值hbase.client.scanner.timeout.period作为属性传递给PhoenixDriver使用原始 JDBC,则该值必须是String,而不是int

就像是:

Properties prop = new Properties();
prop.put("user", "***");
prop.put("password", "***");
prop.put(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, "800000");
Connection connection = DriverManager.getConnection("jdbc:phoenix:10.0.0.1:2181:/hbase-unsecure", prop);

作为记录,我们在 Hbase 1.1 上使用 Phoenix 4.7

于 2018-12-03T14:53:55.557 回答
0

呼叫超时=60000,呼叫持续时间=62365。

看起来您的通话时间超过 10 分钟,这是超时时间。尝试将 hbase-default.xml(或您的自定义)配置文件中的“hbase.master.catalog.timeout”设置为更高的值

于 2015-05-13T07:55:41.620 回答
0

是的,我们在运行命令时添加了相同的属性并解决了这个问题 hbase.client.scanner.timeout.period=600000

Hbase 1.2

于 2021-11-27T13:09:57.107 回答