使用IDEA操作Hbase API 报错:org.apache.hadoop.hbase.client.RetriesExhaustedException的解决方法:

 使用IDEA操作Hbase API 报错:org.apache.hadoop.hbase.client.RetriesExhaustedException的解决方法:

 

1.错误详情:

   Exception in thread “main” org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Fri Feb 14 18:04:10 CST 2020, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=62509: 10000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=server1.com/69.172.201.153:16020] row ‘fruit1,’ on table ‘hbase:meta’ at region=hbase:meta,1.1588230740, hostname=server1.com,16020,1581692957371, seqNum=0…

 

2.问题解决:

 修改本地系统下的C盘文件:  

   C:\Windows\System32\drivers\etc\hosts

 添加:你的虚拟机的ip  主机名.com   主机名
 比如(以我的为例):192.168.137.8  master.com  master
 提示:还可以添加您的 从机

 

3.报错原因:

  java代码:
在这里插入图片描述


  由于hbase会根据192.168.137.8 找到虚拟机主机,并且根据主机hosts文件解析IP127.0.0.1,因此这就造成了无法识别主机名,从而运行报错。

 
 
 
希望可以解决您的问题~~~

如果哪里描述有错误,欢迎大家指出…

posted @ 2020-02-14 20:35  Nahshon  阅读(1615)  评论(0编辑  收藏  举报