遇到的查询超时情况:
Error: org.apache.phoenix.exception.PhoenixIOException: Failed after attempts=16, exceptions:
Fri Dec 14 15:39:31 CST 2018, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=60131: Call to hbase/192.168.199.154:16020 failed on local exception: org.apache.hadoop.hbase.ipc.CallTimeoutException: Call id=60, waitTime=60011, rpcTimeout=60000 row '2018-11-24' on table 'T_EXTENSION_ALL_DATAS' at region=T_EXTENSION_ALL_DATAS,,1544412407862.87318c35c4d1c4aa7eda96c84df7d938., hostname=hbase,16020,1544773067965, seqNum=78862 (state=08000,code=101)
还有删除超时情况:
0: jdbc:phoenix:192.168.199.154> delete from T_EXTENSION_ALL_DATAS;
Error: Operation timed out. (state=TIM01,code=6000)
java.sql.SQLTimeoutException: Operation timed out.
at org.apache.phoenix.exception.SQLExceptionCode$15.newException(SQLExceptionCode.java:406)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:1343)
at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:1239)
at org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
at org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
at org.apache.phoenix.compile.DeleteCompiler$ClientSelectDeleteMutationPlan.execute(DeleteCompiler.java:909)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:408)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:391)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:390)
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:378)
at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1825)
at sqlline.Commands.execute(Commands.java:822)
at sqlline.Commands.sql(Commands.java:732)
at sqlline.SqlLine.dispatch(SqlLine.java:813)
at sqlline.SqlLine.begin(SqlLine.java:686)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:291)
1、hbase目录conf 修改 hbase-site.xml
2、重启hbase
3、140s,查询结果正常
800S,删除结果正常。
参数说明:
phoenix.query.timeoutMs
指定查询在客户端上超时的毫秒数。 默认值是10分钟。
phoenix.query.keepAliveMs
当线程数大于客户端线程池数量,线程在终止之前等待新任务的最长时间(以毫秒为单位)。默认值为60秒。
hbase.rpc.timeout
默认60s,该参数表示一次RPC请求的超时时间。RPC时间超过该值,客户端就会主动关闭socket。
hbase.regionserver.lease.period
regionserer租约时间,默认值是60s,如果生产环境中,在执行一些任务时,如mapreduce时出现lease超时的报错,那这个时候就需要去调大这个值了。
hbase.client.operation.timeout
默认20min,该参数表示HBase客户端发起一次数据操作直至得到响应之间总的超时时间,数据操作类型包括get、append、increment、delete、put等。该值与hbase.rpc.timeout的区别为,hbase.rpc.timeout为一次rpc调用的超时时间。而hbase.client.operation.timeout为一次操作总的时间(从开始调用到重试n次之后失败的总时间)。
hbase.client.scanner.caching
scan缓存,默认为2147483647,不可太大,避免占用过多内存。
hbase.client.scanner.timeout.period
默认60s,该参数是表示HBase客户端发起一次scan操作的rpc调用至得到响应之间总的超时时间。一次scan操作是指发起一次regionserver rpc调用的操作,hbase会根据scan查询条件的cacheing、batch设置将scan操作会分成多次rpc操作。