无法从phoenix表中读取大数据

5lwkijsr  于 2021-06-09  发布在  Hbase
关注(0)|答案(3)|浏览(484)

嗨,我在一个大表上运行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>

请帮忙。

qyuhtwio

qyuhtwio1#

(原题三年后)
我们今天遇到了非常类似的例外:

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

mbyulnm0

mbyulnm02#

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

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

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

phoenix_utils.py  | grep hbase_conf_path
gxwragnw

gxwragnw3#

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

相关问题