Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Hi i am new to hbase and trying to practice it. First of all i would like to describe about system configuration. BACKGROUND:

I am using Windows 7 and installed Oracle Virtual Box. Then installed ubuntu server on Virtual Box after that I installed hbase0.98-hadoop2-bin.tar.gz on ubuntu. I have configured hbase in standalone mode. My hbase-site.xml file is like:

<Configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/abc/hbase</value>
</property>

<property>
<name>hbase.zookeeper.property.rootDir</name>
<value>/home/abc/zookeeper</value>
</property>
</configuration>

Now my hbase shell is working fine it creates table. I can put values and get them.

MAIN PROBLEM:

As stated I am using Windows so I wrote a simple program on eclipse in java to hit hbase (which is basically on virtual box). But I get following exception:

Exception in thread "main" org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to connect to ZooKeeper but the connection closes immediately. This could be a sign that the server has too many connections (30 is the default). Consider inspecting your ZK server logs for that error and then make sure you are reusing HBaseConfiguration as often as you can. See HTable's javadoc for more information.
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:155)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:990)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:303)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:294)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:156)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:168)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:146)
    at HBaseConnector.main(HBaseConnector.java:151)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1021)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1049)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.createAndFailSilent(ZKUtil.java:903)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:133)

My Code: Code in main function is like:

Configuration config = HBaseConfiguration.create();
HTable table = new HTable(config, "myLittleHBaseTable");
Put p = new Put(Bytes.toBytes("myLittleRow"));

WHAT I WANT?

What am i doing wrong? I there any way to access hbase(resided on virtual box) from windows java program?

PLUS:

I studied previously asked questions but none of them was working for me.

Any help would be very appreciative.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
138 views
Welcome To Ask or Share your Answers For Others

1 Answer

Have you tried to set the Network setting of your Virtual box to "bridged Adapter" instead of "NAT" , and then from your Host system , try to open browser and type "guestIP:Hbase_Master_Port"(192.168.1.100:60010 for example ) it should open the master administration page .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...