无法从Windows连接到HBase [英] Not able to connect to HBase from Windows

查看:409
本文介绍了无法从Windows连接到HBase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从Windows运行一个HBase Java Client程序。
我所拥有的是1)没有任何编译错误的Java程序
2)hbase-site.xml
(没有其他HDFS或HBase配置文件,只有上面的。)
当我运行该程序时,出现以下错误 - 在最后一个块中给出。我想念什么?
我在这里给予。

 <?xml version =1.0?> 
<?xml-stylesheet type =text / xslhref =configuration.xsl?>
<配置>
<属性>
<名称> hbase.zookeeper.quorum< / name>
<值> IP地址1,IP地址2,IP地址3< /值>
< / property>
< / configuration>

导入org.apache.hadoop.conf.Configuration;
导入org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;
import java.io.IOException;


public class HConnect
{
public static void main(String [] args)
{
try
{
配置aConfig = HBaseConfiguration.create();
HTable aTable = new HTable(aConfig,TestTable);

byte [] aRowKey = Bytes.toBytes(RowKey1);
Put aPut = new Put(aRowKey);

byte [] aColFamily = Bytes.toBytes(ColumnFamily1);
byte [] aColumn = Bytes.toBytes(Column1);
byte [] aColumnVal = Bytes.toBytes(ColumnValue1);

aPut.add(aColFamily,aColumn,aColumnVal);

aTable.put(aPut);
Table.close();
}
catch(IOException aException_in)
{
System.out.println();
}
}
}



SLF4J:无法加载类org.slf4j.impl.StaticLoggerBinder。
SLF4J:默认为无操作(NOP)记录器实现
SLF4J:有关详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder。
2013年9月27日下午3:16:13 org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper< init>
INFO:此进程的标识符为7948 @ sisavip5-600b
2013年9月27日3:16:15 org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
警告:可能暂时的ZooKeeper异常:org.apache.zookeeper.KeeperException $ ConnectionLossException:KeeperErrorCode = ConnectionLoss for / hbase / hbaseid
Sep 27,2013 3:16:15 PM org.apache.hadoop.hbase.util.RetryCounter sleepUntilNextRetry
INFO:在重试前睡2000ms#1 ...
2013年9月27日下午3时16分18秒org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
警告:可能是暂时的ZooKeeper异常: org.apache.zookeeper.KeeperException $ ConnectionLossException:KeeperErrorCode = ConnectionLoss for / hbase / hbaseid
Sep 27,2013 3:16:18 PM org.apache.hadoop.hbase.util.RetryCounter sleepUntilNextRetry
INFO:睡前4000ms再试#2 ...
2013年9月27日下午3:16:22 org.apache.hadoop.hbase.zookeeper.RecoverableZoo Keeper retryOrThrow
警告:可能是暂时的ZooKeeper异常:org.apache.zookeeper.KeeperException $ ConnectionLossException:KeeperErrorCode = ConnectionLoss for / hbase / hbaseid
Sep 27,2013 3:16:22 PM org.apache.hadoop .hbase.util.RetryCounter sleepUntilNextRetry
INFO:重试前睡眠8000ms#3 ...
2013年9月27日下午3:16:31 org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
警告:可能是暂时的ZooKeeper异常:org.apache.zookeeper.KeeperException $ ConnectionLossException:KeeperErrorCode = ConnectionLoss for / hbase / hbaseid
Sep 27,2013 3:16:31 PM org.apache.hadoop.hbase.zookeeper .RecoverableZooKeeper retryOrThrow
SEVERE:3次重试后ZooKeeper存在失败
2013年9月27日3:16:31 org.apache.hadoop.hbase.zookeeper.ZKUtil checkExists
警告:hconnection无法在znode上设置观察者(/ hbase / hbaseid)
org.apache.zookeeper.KeeperException $ Connection LossException:KeeperErrorCode = ConnectionLoss for / hbase / hbaseid


解决方案

I没有core-site.xml,后来我有一些连接问题
到HDFS名称节点。一旦我解决了这些问题,我就可以插入数据。

在开发将数据插入HBase的客户端程序时,我还解决了以下依赖项:
commons- lang-2.6
commons-logging-1.1.3
slf4j-1.7.5
protobuf -java-2.4.0a。


I am trying to run a HBase Java Client Program from Windows. All I have is 1) A Java Program without any compiler error 2) hbase-site.xml (No other HDFS or HBase config files I have. Only the above one.) When I run the program I get the following error-given in the last block. Do I miss something? Both I am giving here.

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>IP Address1,IPAddress2,IPAddress3</value>    
    </property>
</configuration>

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;
import java.io.IOException;


public class HConnect 
{
    public static void main(String[] args) 
    {
        try
        {
            Configuration   aConfig = HBaseConfiguration.create();
            HTable          aTable  = new HTable(aConfig, "TestTable");

            byte[]          aRowKey = Bytes.toBytes("RowKey1");
            Put             aPut    = new Put(aRowKey);

            byte[]          aColFamily  = Bytes.toBytes("ColumnFamily1");
            byte[]          aColumn     = Bytes.toBytes("Column1");
            byte[]          aColumnVal  = Bytes.toBytes("ColumnValue1");

            aPut.add(aColFamily, aColumn, aColumnVal);

            aTable.put(aPut);
            aTable.close();
        }
        catch(IOException aException_in)
        {
            System.out.println("");
        }
    }
}



 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
   SLF4J: Defaulting to no-operation (NOP) logger implementation
   SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
   Sep 27, 2013 3:16:13 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
   INFO: The identifier of this process is 7948@sisavip5-600b
   Sep 27, 2013 3:16:15 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper        retryOrThrow
   WARNING: Possibly transient ZooKeeper exception:   org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode =   ConnectionLoss for /hbase/hbaseid
    Sep 27, 2013 3:16:15 PM org.apache.hadoop.hbase.util.RetryCounter sleepUntilNextRetry
    INFO: Sleeping 2000ms before retry #1...
    Sep 27, 2013 3:16:18 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper  retryOrThrow
    WARNING: Possibly transient ZooKeeper exception:  org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode =      ConnectionLoss for /hbase/hbaseid
    Sep 27, 2013 3:16:18 PM org.apache.hadoop.hbase.util.RetryCounter sleepUntilNextRetry
    INFO: Sleeping 4000ms before retry #2...
    Sep 27, 2013 3:16:22 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper    retryOrThrow
    WARNING: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode =  ConnectionLoss for /hbase/hbaseid
    Sep 27, 2013 3:16:22 PM org.apache.hadoop.hbase.util.RetryCounter sleepUntilNextRetry
    INFO: Sleeping 8000ms before retry #3...
    Sep 27, 2013 3:16:31 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper   retryOrThrow
    WARNING: Possibly transient ZooKeeper exception:  org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode =  ConnectionLoss for /hbase/hbaseid
    Sep 27, 2013 3:16:31 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
    SEVERE: ZooKeeper exists failed after 3 retries
    Sep 27, 2013 3:16:31 PM org.apache.hadoop.hbase.zookeeper.ZKUtil checkExists
    WARNING: hconnection Unable to set watcher on znode (/hbase/hbaseid)
        org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode =       ConnectionLoss for /hbase/hbaseid

解决方案

I did not have core-site.xml and later I had some connectivity issues to the HDFS name node. Once I solved these I am able to insert data.

Also I resolved the following dependencies while I developed the client program that inserts data into HBase: commons-lang-2.6 commons-logging-1.1.3 slf4j-1.7.5 protobuf-java-2.4.0a .

这篇关于无法从Windows连接到HBase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆