前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >在eclipse中运行hbase时显示Could not resolve the DNS na...

在eclipse中运行hbase时显示Could not resolve the DNS na...

作者头像
闵开慧
发布2018-03-30 12:02:51
1.2K0
发布2018-03-30 12:02:51
举报
文章被收录于专栏:闵开慧闵开慧

ERROR hbase.HServerAddress: Could not resolve the DNS name of ubuntu118

Exception in thread "main" java.lang.IllegalArgumentException: hostname can't be null

at java.net.InetSocketAddress.<init>(InetSocketAddress.java:121)

at org.apache.hadoop.hbase.HServerAddress.getResolvedAddress(HServerAddress.java:108)

at org.apache.hadoop.hbase.HServerAddress.<init>(HServerAddress.java:64)

at org.apache.hadoop.hbase.MasterAddressTracker.getMasterAddress(MasterAddressTracker.java:63)

at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:561)

at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:99)

at com.biencloud.test.first_hbase.main(first_hbase.java:23)

这个问题说明运行eclipse的机器没有检测到运行hbase的机器的域名,运行eclipse的机器无论是在linux还是windows中,都需要将运行hbase的ip和机器名添加到系统配置文件中。

1 如果eclipse运行在linux中,添加配置具体如下:

nano /etc/hosts

在其中添加

192.168.0.118   ubuntu118

192.168.0.186   ubuntu186

192.168.0.182   ubuntu182

2 如果eclipse运行在windows中,添加配置如下:

进入C:\WINDOWS\system32\drivers\etc,打开其中的hosts文件,在其中加入

192.168.0.118   ubuntu118

192.168.0.186   ubuntu186

192.168.0.182   ubuntu182

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档