大家好,我在一个大表上运行phoenix计数查询时,得到了下面的错误消息。
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>
请帮帮忙。
发布于 2015-11-26 01:20:52
在hbase服务器和客户端配置中,您需要将下面的hbase配置属性增加到更高的值,默认值为1分钟(60000毫秒)
<property>
<name>hbase.rpc.timeout</name>
<value>600000</value>
</property>
最重要的是,下面的命令应该返回正确的hbase配置目录,其中hbase-site.xml文件包含上述属性。如果hbase_conf_path的值为空或.,请在执行命令sqlline.py
之前执行命令export HADOOP_CONF_DIR=<correct_hbase_dir>;
以指向正确的hbase配置。
phoenix_utils.py | grep hbase_conf_path
发布于 2018-12-03 22:53:56
(原问题提出三年后)
我们今天遇到了非常相似的异常:
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
。它可以在名为HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD
的类org.apache.hadoop.hbase.HConstants
中找到。
请注意,如果使用原始JDBC将hbase.client.scanner.timeout.period
的值作为属性传递给PhoenixDriver
,则该值必须为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
发布于 2021-11-27 13:09:57
是的,我们在运行命令时添加了相同的属性,并通过hbase.client.scanner.timeout.period=600000解决了此问题
Hbase 1.2
https://stackoverflow.com/questions/27856730
复制相似问题