Hbase链接数据库时,在循环遍历result时,前四次遍历取数正常,第5次报错 20C

代码如下:
图片说明
p://img.ask.csdn.net/upload/201710/31/1509412397_714565.png)

报错异常如下:,,,求大神帮忙

  1. java.lang.RuntimeException: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
    Tue Oct 31 09:03:17 CST 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=60108: row '10.10.49.161_150935' on table 'HOST_RESRC' at region=HOST_RESRC,10.10.47.55_1507847553,1509329651091.3ede1b811762ae5d54b7575a55f26a5a., hostname=node1,16020,1509329624220, seqNum=63801830

    at org.apache.hadoop.hbase.client.AbstractClientScanner$1.hasNext(AbstractClientScanner.java:97)
    at com.nantian.zabbix.service.impl.TestHbase.querybasic(TestHbase.java:135)
    at com.nantian.zabbix.service.impl.TestHbase.main(TestHbase.java:61)
    Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
    Tue Oct 31 09:03:17 CST 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=60108: row '10.10.49.161_150935' on table 'HOST_RESRC' at region=HOST_RESRC,10.10.47.55_1507847553,1509329651091.3ede1b811762ae5d54b7575a55f26a5a., hostname=node1,16020,1509329624220, seqNum=63801830

    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.hadoop.hbase.client.AbstractClientScanner$1.hasNext(AbstractClientScanner.java:94)
    ... 2 more
    Caused by: java.net.SocketTimeoutException: callTimeout=60000, callDuration=60108: row '10.10.49.161_150935' on table 'HOST_RESRC' at region=HOST_RESRC,10.10.47.55_1507847553,1509329651091.3ede1b811762ae5d54b7575a55f26a5a., hostname=node1,16020,1509329624220, seqNum=63801830
    at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:169)
    at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Call to node1/10.10.49.182:16020 failed on local exception: org.apache.hadoop.hbase.ipc.CallTimeoutException: Call id=3, waitTime=60001, operationTimeout=60000 expired.
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient.wrapException(AbstractRpcClient.java:284)
    at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1238)
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:223)
    at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:328)
    at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:32831)
    at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:215)
    at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:63)
    at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:210)
    at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:364)
    at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:338)
    at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:136)
    ... 4 more
    Caused by: org.apache.hadoop.hbase.ipc.CallTimeoutException: Call id=3, waitTime=60001, operationTimeout=60000 expired.
    at org.apache.hadoop.hbase.ipc.Call.checkAndSetTimeout(Call.java:70)
    at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1212)
    ... 13 more

3个回答

Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Tue Oct 31 09:03:17 CST 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=60108: row '10.10.49.161_150935' on table 'HOST_RESRC' at region=HOST_RESRC,10.10.47.55_1507847553,1509329651091.3ede1b811762ae5d54b7575a55f26a5a., hostname=node1,16020,1509329624220, seqNum=63801830

1、看看传入的字段是否和表中字段一致
2、设置一下最大的超时响应时间
试试看吧

helloyourkey
helloyourkey 回复qq_38774360: 响应时间去看看你的配置文件,里面应该是有设置最大响应的时限的callTimeout=60000
接近 3 年之前 回复
helloyourkey
helloyourkey 回复qq_38774360: 没有相应的字段会报异常,而不是空啊
接近 3 年之前 回复
qq_38774360
**飞星** 时间设置太长也没有意义啊,怎么应用啊
接近 3 年之前 回复
qq_38774360
**飞星** 如果表中没有相应的字段不应该返回空的吗?也不应该报错啊,
接近 3 年之前 回复

空指针异常,检查空指针问题

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐