栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

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

看尚硅谷视频,在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,会出现不能编辑的问题,更改一下文件的权限就好了

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/336271.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号