Exception in thread “main“ org.apache.hadoop.hbase.client.RetriesExhaustedException: Can‘t get the l

Exception in thread “main“ org.apache.hadoop.hbase.client.RetriesExhaustedException: Can‘t get the l,第1张

Exception in thread “main“ org.apache.hadoop.hbase.client.RetriesExhaustedException: Can‘t get the l

看尚硅谷视频,在windows上运行集群上的hbase时

package org.example;

import org.apache.hadoop.hbase.HbaseConfiguration;
import org.apache.hadoop.hbase.client.HbaseAdmin;

import java.io.IOException;

public class TestHbaseApi {
    private static HbaseConfiguration conf;
    private static HbaseAdmin admin;
    public static void conncet2Hbase() throws IOException {
        conf=new HbaseConfiguration();
        conf.set("hbase.zookeeper.quorum","node1,node2,node3");
        admin=new HbaseAdmin(conf);
    }

    public static boolean isTableExist(String tableName) throws IOException {
       boolean is;
       is=admin.tableExists(tableName);
       admin.close();
       return is;
    }


    public static void main(String[] args) throws IOException {
        conncet2Hbase();
        String tableName="ORDER_INFO";
        System.out.println(isTableExist(tableName));
    }
}

出现了以下的错误,说找不到位置:

Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations

其实是windows不认识node1,node2,node3是什么意思,去windows的hosts文件夹下把 node1的ip 和node1做一个映射,跟linux上的hosts一样
C:WindowsSystem32driversetchosts,会出现不能编辑的问题,更改一下文件的权限就好了

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4667364.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-06
下一篇 2022-11-06

发表评论

登录后才能评论

评论列表(0条)

保存