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:\Windows\System32\drivers\etc\hosts,会出现不能编辑的问题,更改一下文件的权限就好了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值