2 hanmini hanmini 于 2016.04.07 10:10 提问

java调用Hbase java.net.SocketTimeoutException

hbase菜鸟,工作需要,请大神帮忙。java连接hbase出现的错误error如下:
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Thu Apr 07 09:43:39 CST 2016, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=80156: row 'gpsinfo,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=zpu-storage3,16020,1443175301611, seqNum=0

at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:271)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:207)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:320)
at org.apache.hadoop.hbase.client.ClientScanner.loadCache(ClientScanner.java:401)
at org.apache.hadoop.hbase.client.ClientScanner.next(ClientScanner.java:364)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:604)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:392)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:402)
at Test.main(Test.java:19)

Caused by: java.net.SocketTimeoutException: callTimeout=60000, callDuration=80156: row 'gpsinfo,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=zpu-storage3,16020,1443175301611, seqNum=0
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:159)
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.net.UnknownHostException: unknown host: zpu-storage3
at org.apache.hadoop.hbase.ipc.RpcClientImpl$Connection.(RpcClientImpl.java:303)
at org.apache.hadoop.hbase.ipc.RpcClientImpl.createConnection(RpcClientImpl.java:133)
at org.apache.hadoop.hbase.ipc.RpcClientImpl.getConnection(RpcClientImpl.java:1283)
at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1191)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:222)
at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:323)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.scan(ClientProtos.java:32831)
at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:373)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:200)
at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:62)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:360)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:334)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:126)
... 4 more

5个回答

CSDNXIAOD
CSDNXIAOD   2016.04.07 10:21

java.net.SocketTimeoutException
java调用.net的webservice
java调用.net的webservice
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

u014071934
u014071934   2016.10.13 11:58

将zk的所有IP添加都windows下C:\Windows\System32\drivers\etc\hosts文件中。且要必须将hbase-site.xml的配置文件添加到项目src下

qq_29267763
qq_29267763   2016.04.07 10:22

不知道vcbc 幸福幸福但是防守打法感到个飞 关系的股份

u014071934
u014071934   2016.10.13 11:57

将java连接hbase的IP地址添加到windows下C:\Windows\System32\drivers\etc\hosts文件中。

qq_31598175
qq_31598175   2017.11.21 14:12

C:\Windows\System32\drivers\etc\hosts文件中配置的域名与ip对应关系不对产生的

qq_28958301
qq_28958301 localhost呢?也需要配置?同样报这个错误
大约一个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!