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
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有