0
votes

I've started a standalone HBase in a server(192.168.36.42)

Client Side

package com.test;

import java.util.ArrayList;

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;

public class HBaseClient {

    public static void main(String[] args) throws Exception {
        Configuration config = HBaseConfiguration.create();
        System.out.println("IP Address : " + config.get("hbase.zookeeper.quorum"));

        HTable table = new HTable(config, "test_table");
        ArrayList<Put> data = new ArrayList<Put>();
        Put p = new Put("row3".getBytes());
        p.add("field1".getBytes(), "qualifier".getBytes(), "value".getBytes());

        table.put(data);
        table.flushCommits();

        data.clear();
        table.close();
        System.out.println("close table");
    }
}

Here's the console output of client side :

14/02/26 16:21:31 INFO ipc.HBaseRPC: Server at BJ-NQ-V-CR002/192.168.36.42:44525 could not be reached after 1 tries, giving up.
14/02/26 16:21:33 INFO ipc.HBaseRPC: Server at BJ-NQ-V-CR002/192.168.36.42:44525 could not be reached after 1 tries, giving up.
14/02/26 16:21:35 INFO ipc.HBaseRPC: Server at BJ-NQ-V-CR002/192.168.36.42:44525 could not be reached after 1 tries, giving up.
14/02/26 16:21:37 INFO ipc.HBaseRPC: Server at BJ-NQ-V-CR002/192.168.36.42:44525 could not be reached after 1 tries, giving up.

Client side /etc/host:

192.168.36.42   BJ-NQ-V-CR002

hbase-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>BJ-NQ-V-CR002</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
  </property>
</configuration>

Server Side

hbase(main):003:0> describe 'test_table'
DESCRIPTION                                                                                                        ENABLED                                                        
 'test_table', {NAME => 'field1', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0',  true                                                           
 VERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false',                                                                 
 BLOCKSIZE => '65536', IN_MEMORY => 'false', ENCODE_ON_DISK => 'true', BLOCKCACHE => 'true'}, {NAME => 'field2', D                                                                
 ATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'N                                                                
 ONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY =>                                                                
  'false', ENCODE_ON_DISK => 'true', BLOCKCACHE => 'true'}                                                                                                                        
1 row(s) in 0.1680 seconds

/etc/hosts

127.0.0.1  BJ-NQ-V-CR002
127.0.0.1  localhost localhost.localdomain
192.168.36.42 BJ-NQ-V-CR002

hbase-site.xml

<configuration>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>BJ-NQ-V-CR002</value>
  </property>
  <property>
    <name>hbase.rootdir</name>
    <value>file:///root/hbase-0.94.16/data/hbase</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/root/hbase-0.94.16/data/zookeeper</value>
  </property>
</configuration>

regionservers

BJ-NQ-V-CR002
1

1 Answers

0
votes

You log does not show any timeout exception, just some zookeeper output. Nevertheless I have seen this before.

Check if you can put from hbase shell. You likely have only one region server that serves this table and there is a problem with it. Either the region server in question is down or table file is unavailable on hdfs.

Restart the region server and watch its logs