Hbase Java客户端连接Hbase运行后长时间卡住,最后报错
hbase执行到Result result = table.get(get)卡死
由于本人没有接触过hbase,使用公司原有的获取hhase内容的代码片段,
执行到Result result = table.get(get)一直卡死不动,
下面是conf的配置内容:
conf.set("hbase.zookeeper.quorum","10.200.1.121,10.200.1.123,10.200.1.120,10.200.1.3");
conf.set("hbase.zookeeper.property.clientPort","2181");
经过很长时间之后报了超时异常,
后来在网上发现同类问题,尝试了在本地hosts文件写入ip和机器名的映射,
10.200.1.121 company-x1
10.200.1.123 company-x2
10.200.1.120 company-x3
10.200.1.3 company-x4
conf.set("hbase.zookeeper.quorum","company-x1,company-x2,company-x3,company-x4");
conf.set("hbase.zookeeper.property.clientPort","2181");
之后便可以得到结果;
但是还是有疑问,为什么在代码里面直接写ip地址却不行,希望前辈可以帮忙解答;