zoukankan      html  css  js  c++  java
  • eclipse连接不到hbase解决

    由于虚拟机运行比较卡顿,因此我觉定把其相关编程在主机的eclipse上运行,但在虚拟机上运行的好好程序到了本机上却不管用了,连接不到hbase,卡在一个地方不动

     映射什么的都没问题但就是连接不上

     看了https://www.cnblogs.com/huan-ch/p/11689016.html#4709881这篇贴子后终于解决

    修改连接的代码就解决了

    原本的连接方式

    public static void getConnection() {
    			configuration = HBaseConfiguration.create();
    			configuration.set("hbase.rootdir", "hdfs://192.168.146.131:9000/text");
    			
    			try {
    				connection = ConnectionFactory.createConnection(configuration);
    				admin = connection.getAdmin();
    			}catch (Exception e) {
    				// TODO: handle exception
    				e.printStackTrace();
    			}
    		}
    

      改为

    public static void getConnection() {
    			configuration = HBaseConfiguration.create();
    			configuration.set("hbase.zookeeper.quorum", "192.168.146.131");
    			configuration.set("hbase.zookeeper.pronperty.clientPort","2181");
    			try {
    				connection = ConnectionFactory.createConnection(configuration);
    				admin = connection.getAdmin();
    			}catch (Exception e) {
    				// TODO: handle exception
    				e.printStackTrace();
    			}
    		}
    

      成功解决

  • 相关阅读:
    Delphi IDE 设置
    我最喜欢的歌曲
    Window 常用文件
    Delphi TTable 组件
    Delphi TDatabase 组件
    c语言->和 .
    Shell 工具之 gawk
    Shell 工具之 sed
    Shell 语法之函数
    Shell 语法之信号与作业
  • 原文地址:https://www.cnblogs.com/liuleliu/p/13837442.html
Copyright © 2011-2022 走看看