You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Shuja Rehman <sh...@gmail.com> on 2010/10/28 23:11:20 UTC

Hbase Java Client

Hi
I have written a small program to connect to hbase but it stuck half way and
just go in the wait state.

*Here is the code

*   System.out.println("Start");
    HBaseConfiguration config = new HBaseConfiguration();
    config.clear();
    config.set("hbase.zookeeper.quorum", "10.10.10.2:2181");
    config.set("hbase.zookeeper.property.clientPort","2181");
    System.out.println("Before Htable");
     HTable table = new HTable(config, "rnc");
     System.out.println("After Htable");

      System.out.println("Before Get");
    Get g = new Get(Bytes.toBytes("20100926000000P123TREDFR$#"));
    Result r = table.get(g);
    byte [] value = r.getValue(Bytes.toBytes("Info"),
      Bytes.toBytes("COL_STAGE"));
    // If we convert the value bytes, we should get back 'Some Value', the
    // value we inserted at this location.
    String valueStr = Bytes.toString(value);
    System.out.println("GET: " + valueStr);

*And here is the system Output*


*Start*
10/10/29 02:05:46 WARN hbase.HBaseConfiguration: instantiating
HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create()
to construct a plain Configuration
*Before Htable*
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:zookeeper.version=3.3.1-942149, built on 05/07/2010 17:14 GMT
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:host.name=DV
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.version=1.6.0_21
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.vendor=Sun Microsystems Inc.
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.home=C:\Program Files\Java\jdk1.6.0_21\jre
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.class.path=D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hbase-0.89.20100621+17.jar;D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hadoop-core-0.20.2+320.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\commons-logging-1.1.1.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\zookeeper-3.3.1+7.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\log4j-1.2.15.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\build\classes;D:\FreeLauncing\DataWareHouse\HBaseClient\src
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.library.path=C:\Program
Files\Java\jdk1.6.0_21\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program
Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\PC
Connectivity
Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program
Files\Microsoft SQL Server\90\Tools\binn\;C:\Program
Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL
Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual
Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Windows
Live\Shared
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.io.tmpdir=C:\Users\shuja\AppData\Local\Temp\
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:java.compiler=<NA>
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows
7
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:os.version=6.1
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:user.name
=shuja
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:user.home=C:\Users\shuja
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
environment:user.dir=D:\FreeLauncing\DataWareHouse\HBaseClient
10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Initiating client connection,
connectString=10.10.10.2:2181 sessionTimeout=60000
watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@183f74d
10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Opening socket connection to
server /10.10.10.2:2181
10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Socket connection established
to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
10/10/29 02:05:48 INFO zookeeper.ClientCnxn: Session establishment complete
on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
0x12bf232ec580014, negotiated timeout = 40000


Can anybody tells why it is not proceeding???
-- 
Regards
Shuja-ur-Rehman Baig
http://pk.linkedin.com/in/shujamughal
Cell: +92 3214207445

Re: Hbase Java Client

Posted by Shuja Rehman <sh...@gmail.com>.
Hi J-D,

I have solved the problem. The problem was that server has latest CDHb3 jars
while client has old CDHb2 jars. I have replaced the client jars and it
starts working,

Thanks

On Mon, Nov 1, 2010 at 10:33 PM, Jean-Daniel Cryans <jd...@apache.org>wrote:

> According to the log it seems that you have a flaky VPN connection, or
> some weirdness like that. In one case your client wasn't able to talk
> to the ZK server for 26 seconds, which is kind of a huge deal. You
> should look into that.
>
> J-D
>
> On Fri, Oct 29, 2010 at 6:55 AM, Shuja Rehman <sh...@gmail.com>
> wrote:
> > Hi
> > I have checked the given link. According to it, it does not work from
> > windows platform. Let me explain the whole scenario. I have cluster of 4
> > machines on which ubuntu is running. I have connected to this cluster
> using
> > VPN and i have windows 7 installed and i am using netbeans to develop the
> > program. So is there anyway to find the problem?
> >
> > one progress in output. it prints one more line in addition to previous
> > output. here is the output from the end.
> >
> > 10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Opening socket connection to
> > server /10.10.10.2:2181
> > 10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Socket connection
> established
> > to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> > 10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Session establishment
> complete
> > on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> > 0x12bf232ec58001b, negotiated timeout = 40000
> > 10/10/29 18:46:40 INFO ipc.HbaseRPC: Problem connecting to server: /
> > 10.10.10.2:60020
> > 10/10/29 18:46:47 INFO zookeeper.ClientCnxn: Client session timed out,
> have
> > not heard from server in 26666ms for sessionid 0x12bf232ec58001b, closing
> > socket connection and attempting reconnect
> > 10/10/29 18:46:48 INFO zookeeper.ClientCnxn: Opening socket connection to
> > server app4.hsd1.wa.comcast.net/10.10.10.2:2181
> > 10/10/29 18:46:58 INFO zookeeper.ClientCnxn: Socket connection
> established
> > to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> > 10/10/29 18:46:58 INFO zookeeper.ClientCnxn: Session establishment
> complete
> > on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> > 0x12bf232ec58001b, negotiated timeout = 40000
> > 10/10/29 18:47:01 INFO ipc.HbaseRPC: Problem connecting to server: /
> > 10.10.10.2:60020
> >
> >
> > Can anybody here to sort out this issue?
> >
> > Thanks in advance
> >
> > On Fri, Oct 29, 2010 at 2:24 AM, Jean-Daniel Cryans <jdcryans@apache.org
> >wrote:
> >
> >> Hard to tell without a jstack
> >> (
> http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html)
> >>
> >> J-D
> >>
> >> On Thu, Oct 28, 2010 at 2:11 PM, Shuja Rehman <sh...@gmail.com>
> >> wrote:
> >> > Hi
> >> > I have written a small program to connect to hbase but it stuck half
> way
> >> and
> >> > just go in the wait state.
> >> >
> >> > *Here is the code
> >> >
> >> > *   System.out.println("Start");
> >> >    HBaseConfiguration config = new HBaseConfiguration();
> >> >    config.clear();
> >> >    config.set("hbase.zookeeper.quorum", "10.10.10.2:2181");
> >> >    config.set("hbase.zookeeper.property.clientPort","2181");
> >> >    System.out.println("Before Htable");
> >> >     HTable table = new HTable(config, "rnc");
> >> >     System.out.println("After Htable");
> >> >
> >> >      System.out.println("Before Get");
> >> >    Get g = new Get(Bytes.toBytes("20100926000000P123TREDFR$#"));
> >> >    Result r = table.get(g);
> >> >    byte [] value = r.getValue(Bytes.toBytes("Info"),
> >> >      Bytes.toBytes("COL_STAGE"));
> >> >    // If we convert the value bytes, we should get back 'Some Value',
> the
> >> >    // value we inserted at this location.
> >> >    String valueStr = Bytes.toString(value);
> >> >    System.out.println("GET: " + valueStr);
> >> >
> >> > *And here is the system Output*
> >> >
> >> >
> >> > *Start*
> >> > 10/10/29 02:05:46 WARN hbase.HBaseConfiguration: instantiating
> >> > HBaseConfiguration() is deprecated. Please use
> >> HBaseConfiguration#create()
> >> > to construct a plain Configuration
> >> > *Before Htable*
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:zookeeper.version=3.3.1-942149, built on 05/07/2010 17:14
> GMT
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:
> host.name
> >> =DV
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:java.version=1.6.0_21
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:java.vendor=Sun Microsystems Inc.
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:java.home=C:\Program Files\Java\jdk1.6.0_21\jre
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> >
> >>
> environment:java.class.path=D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hbase-0.89.20100621+17.jar;D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hadoop-core-0.20.2+320.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\commons-logging-1.1.1.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\zookeeper-3.3.1+7.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\log4j-1.2.15.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\build\classes;D:\FreeLauncing\DataWareHouse\HBaseClient\src
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:java.library.path=C:\Program
> >> >
> >>
> Files\Java\jdk1.6.0_21\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program
> >> > Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\PC
> >> > Connectivity
> >> >
> >>
> Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program
> >> > Files\Microsoft SQL Server\90\Tools\binn\;C:\Program
> >> > Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL
> >> > Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
> >> > Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
> >> > Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
> >> Visual
> >> > Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Windows
> >> > Live\Shared
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:java.io.tmpdir=C:\Users\shuja\AppData\Local\Temp\
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:java.compiler=<NA>
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:
> os.name
> >> =Windows
> >> > 7
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> environment:os.arch=x86
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:os.version=6.1
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:
> user.name
> >> > =shuja
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:user.home=C:\Users\shuja
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >> > environment:user.dir=D:\FreeLauncing\DataWareHouse\HBaseClient
> >> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Initiating client
> connection,
> >> > connectString=10.10.10.2:2181 sessionTimeout=60000
> >> >
> >>
> watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@183f74d
> >> > 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Opening socket connection
> to
> >> > server /10.10.10.2:2181
> >> > 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Socket connection
> >> established
> >> > to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> >> > 10/10/29 02:05:48 INFO zookeeper.ClientCnxn: Session establishment
> >> complete
> >> > on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> >> > 0x12bf232ec580014, negotiated timeout = 40000
> >> >
> >> >
> >> > Can anybody tells why it is not proceeding???
> >> > --
> >> > Regards
> >> > Shuja-ur-Rehman Baig
> >> > http://pk.linkedin.com/in/shujamughal
> >> > Cell: +92 3214207445
> >> >
> >>
> >
> >
> >
> > --
> > Regards
> > Shuja-ur-Rehman Baig
> > http://pk.linkedin.com/in/shujamughal
> > Cell: +92 3214207445
> >
>



-- 
Regards
Shuja-ur-Rehman Baig
<http://pk.linkedin.com/in/shujamughal>

Re: Hbase Java Client

Posted by Jean-Daniel Cryans <jd...@apache.org>.
According to the log it seems that you have a flaky VPN connection, or
some weirdness like that. In one case your client wasn't able to talk
to the ZK server for 26 seconds, which is kind of a huge deal. You
should look into that.

J-D

On Fri, Oct 29, 2010 at 6:55 AM, Shuja Rehman <sh...@gmail.com> wrote:
> Hi
> I have checked the given link. According to it, it does not work from
> windows platform. Let me explain the whole scenario. I have cluster of 4
> machines on which ubuntu is running. I have connected to this cluster using
> VPN and i have windows 7 installed and i am using netbeans to develop the
> program. So is there anyway to find the problem?
>
> one progress in output. it prints one more line in addition to previous
> output. here is the output from the end.
>
> 10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Opening socket connection to
> server /10.10.10.2:2181
> 10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Socket connection established
> to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> 10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Session establishment complete
> on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> 0x12bf232ec58001b, negotiated timeout = 40000
> 10/10/29 18:46:40 INFO ipc.HbaseRPC: Problem connecting to server: /
> 10.10.10.2:60020
> 10/10/29 18:46:47 INFO zookeeper.ClientCnxn: Client session timed out, have
> not heard from server in 26666ms for sessionid 0x12bf232ec58001b, closing
> socket connection and attempting reconnect
> 10/10/29 18:46:48 INFO zookeeper.ClientCnxn: Opening socket connection to
> server app4.hsd1.wa.comcast.net/10.10.10.2:2181
> 10/10/29 18:46:58 INFO zookeeper.ClientCnxn: Socket connection established
> to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> 10/10/29 18:46:58 INFO zookeeper.ClientCnxn: Session establishment complete
> on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> 0x12bf232ec58001b, negotiated timeout = 40000
> 10/10/29 18:47:01 INFO ipc.HbaseRPC: Problem connecting to server: /
> 10.10.10.2:60020
>
>
> Can anybody here to sort out this issue?
>
> Thanks in advance
>
> On Fri, Oct 29, 2010 at 2:24 AM, Jean-Daniel Cryans <jd...@apache.org>wrote:
>
>> Hard to tell without a jstack
>> (http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html)
>>
>> J-D
>>
>> On Thu, Oct 28, 2010 at 2:11 PM, Shuja Rehman <sh...@gmail.com>
>> wrote:
>> > Hi
>> > I have written a small program to connect to hbase but it stuck half way
>> and
>> > just go in the wait state.
>> >
>> > *Here is the code
>> >
>> > *   System.out.println("Start");
>> >    HBaseConfiguration config = new HBaseConfiguration();
>> >    config.clear();
>> >    config.set("hbase.zookeeper.quorum", "10.10.10.2:2181");
>> >    config.set("hbase.zookeeper.property.clientPort","2181");
>> >    System.out.println("Before Htable");
>> >     HTable table = new HTable(config, "rnc");
>> >     System.out.println("After Htable");
>> >
>> >      System.out.println("Before Get");
>> >    Get g = new Get(Bytes.toBytes("20100926000000P123TREDFR$#"));
>> >    Result r = table.get(g);
>> >    byte [] value = r.getValue(Bytes.toBytes("Info"),
>> >      Bytes.toBytes("COL_STAGE"));
>> >    // If we convert the value bytes, we should get back 'Some Value', the
>> >    // value we inserted at this location.
>> >    String valueStr = Bytes.toString(value);
>> >    System.out.println("GET: " + valueStr);
>> >
>> > *And here is the system Output*
>> >
>> >
>> > *Start*
>> > 10/10/29 02:05:46 WARN hbase.HBaseConfiguration: instantiating
>> > HBaseConfiguration() is deprecated. Please use
>> HBaseConfiguration#create()
>> > to construct a plain Configuration
>> > *Before Htable*
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:zookeeper.version=3.3.1-942149, built on 05/07/2010 17:14 GMT
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:host.name
>> =DV
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:java.version=1.6.0_21
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:java.vendor=Sun Microsystems Inc.
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:java.home=C:\Program Files\Java\jdk1.6.0_21\jre
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> >
>> environment:java.class.path=D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hbase-0.89.20100621+17.jar;D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hadoop-core-0.20.2+320.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\commons-logging-1.1.1.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\zookeeper-3.3.1+7.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\log4j-1.2.15.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\build\classes;D:\FreeLauncing\DataWareHouse\HBaseClient\src
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:java.library.path=C:\Program
>> >
>> Files\Java\jdk1.6.0_21\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program
>> > Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\PC
>> > Connectivity
>> >
>> Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program
>> > Files\Microsoft SQL Server\90\Tools\binn\;C:\Program
>> > Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL
>> > Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
>> > Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
>> > Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
>> Visual
>> > Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Windows
>> > Live\Shared
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:java.io.tmpdir=C:\Users\shuja\AppData\Local\Temp\
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:java.compiler=<NA>
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:os.name
>> =Windows
>> > 7
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> environment:os.arch=x86
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:os.version=6.1
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:user.name
>> > =shuja
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:user.home=C:\Users\shuja
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
>> > environment:user.dir=D:\FreeLauncing\DataWareHouse\HBaseClient
>> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Initiating client connection,
>> > connectString=10.10.10.2:2181 sessionTimeout=60000
>> >
>> watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@183f74d
>> > 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Opening socket connection to
>> > server /10.10.10.2:2181
>> > 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Socket connection
>> established
>> > to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
>> > 10/10/29 02:05:48 INFO zookeeper.ClientCnxn: Session establishment
>> complete
>> > on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
>> > 0x12bf232ec580014, negotiated timeout = 40000
>> >
>> >
>> > Can anybody tells why it is not proceeding???
>> > --
>> > Regards
>> > Shuja-ur-Rehman Baig
>> > http://pk.linkedin.com/in/shujamughal
>> > Cell: +92 3214207445
>> >
>>
>
>
>
> --
> Regards
> Shuja-ur-Rehman Baig
> http://pk.linkedin.com/in/shujamughal
> Cell: +92 3214207445
>

Re: Hbase Java Client

Posted by Shuja Rehman <sh...@gmail.com>.
Hi
I have checked the given link. According to it, it does not work from
windows platform. Let me explain the whole scenario. I have cluster of 4
machines on which ubuntu is running. I have connected to this cluster using
VPN and i have windows 7 installed and i am using netbeans to develop the
program. So is there anyway to find the problem?

one progress in output. it prints one more line in addition to previous
output. here is the output from the end.

10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Opening socket connection to
server /10.10.10.2:2181
10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Socket connection established
to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
10/10/29 18:40:32 INFO zookeeper.ClientCnxn: Session establishment complete
on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
0x12bf232ec58001b, negotiated timeout = 40000
10/10/29 18:46:40 INFO ipc.HbaseRPC: Problem connecting to server: /
10.10.10.2:60020
10/10/29 18:46:47 INFO zookeeper.ClientCnxn: Client session timed out, have
not heard from server in 26666ms for sessionid 0x12bf232ec58001b, closing
socket connection and attempting reconnect
10/10/29 18:46:48 INFO zookeeper.ClientCnxn: Opening socket connection to
server app4.hsd1.wa.comcast.net/10.10.10.2:2181
10/10/29 18:46:58 INFO zookeeper.ClientCnxn: Socket connection established
to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
10/10/29 18:46:58 INFO zookeeper.ClientCnxn: Session establishment complete
on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
0x12bf232ec58001b, negotiated timeout = 40000
10/10/29 18:47:01 INFO ipc.HbaseRPC: Problem connecting to server: /
10.10.10.2:60020


Can anybody here to sort out this issue?

Thanks in advance

On Fri, Oct 29, 2010 at 2:24 AM, Jean-Daniel Cryans <jd...@apache.org>wrote:

> Hard to tell without a jstack
> (http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html)
>
> J-D
>
> On Thu, Oct 28, 2010 at 2:11 PM, Shuja Rehman <sh...@gmail.com>
> wrote:
> > Hi
> > I have written a small program to connect to hbase but it stuck half way
> and
> > just go in the wait state.
> >
> > *Here is the code
> >
> > *   System.out.println("Start");
> >    HBaseConfiguration config = new HBaseConfiguration();
> >    config.clear();
> >    config.set("hbase.zookeeper.quorum", "10.10.10.2:2181");
> >    config.set("hbase.zookeeper.property.clientPort","2181");
> >    System.out.println("Before Htable");
> >     HTable table = new HTable(config, "rnc");
> >     System.out.println("After Htable");
> >
> >      System.out.println("Before Get");
> >    Get g = new Get(Bytes.toBytes("20100926000000P123TREDFR$#"));
> >    Result r = table.get(g);
> >    byte [] value = r.getValue(Bytes.toBytes("Info"),
> >      Bytes.toBytes("COL_STAGE"));
> >    // If we convert the value bytes, we should get back 'Some Value', the
> >    // value we inserted at this location.
> >    String valueStr = Bytes.toString(value);
> >    System.out.println("GET: " + valueStr);
> >
> > *And here is the system Output*
> >
> >
> > *Start*
> > 10/10/29 02:05:46 WARN hbase.HBaseConfiguration: instantiating
> > HBaseConfiguration() is deprecated. Please use
> HBaseConfiguration#create()
> > to construct a plain Configuration
> > *Before Htable*
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:zookeeper.version=3.3.1-942149, built on 05/07/2010 17:14 GMT
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:host.name
> =DV
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:java.version=1.6.0_21
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:java.vendor=Sun Microsystems Inc.
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:java.home=C:\Program Files\Java\jdk1.6.0_21\jre
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> >
> environment:java.class.path=D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hbase-0.89.20100621+17.jar;D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hadoop-core-0.20.2+320.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\commons-logging-1.1.1.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\zookeeper-3.3.1+7.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\log4j-1.2.15.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\build\classes;D:\FreeLauncing\DataWareHouse\HBaseClient\src
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:java.library.path=C:\Program
> >
> Files\Java\jdk1.6.0_21\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program
> > Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\PC
> > Connectivity
> >
> Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program
> > Files\Microsoft SQL Server\90\Tools\binn\;C:\Program
> > Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL
> > Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
> > Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
> > Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
> Visual
> > Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Windows
> > Live\Shared
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:java.io.tmpdir=C:\Users\shuja\AppData\Local\Temp\
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:java.compiler=<NA>
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:os.name
> =Windows
> > 7
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:os.arch=x86
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:os.version=6.1
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:user.name
> > =shuja
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:user.home=C:\Users\shuja
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> > environment:user.dir=D:\FreeLauncing\DataWareHouse\HBaseClient
> > 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Initiating client connection,
> > connectString=10.10.10.2:2181 sessionTimeout=60000
> >
> watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@183f74d
> > 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Opening socket connection to
> > server /10.10.10.2:2181
> > 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Socket connection
> established
> > to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> > 10/10/29 02:05:48 INFO zookeeper.ClientCnxn: Session establishment
> complete
> > on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> > 0x12bf232ec580014, negotiated timeout = 40000
> >
> >
> > Can anybody tells why it is not proceeding???
> > --
> > Regards
> > Shuja-ur-Rehman Baig
> > http://pk.linkedin.com/in/shujamughal
> > Cell: +92 3214207445
> >
>



-- 
Regards
Shuja-ur-Rehman Baig
http://pk.linkedin.com/in/shujamughal
Cell: +92 3214207445

Re: Hbase Java Client

Posted by Jean-Daniel Cryans <jd...@apache.org>.
Hard to tell without a jstack
(http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html)

J-D

On Thu, Oct 28, 2010 at 2:11 PM, Shuja Rehman <sh...@gmail.com> wrote:
> Hi
> I have written a small program to connect to hbase but it stuck half way and
> just go in the wait state.
>
> *Here is the code
>
> *   System.out.println("Start");
>    HBaseConfiguration config = new HBaseConfiguration();
>    config.clear();
>    config.set("hbase.zookeeper.quorum", "10.10.10.2:2181");
>    config.set("hbase.zookeeper.property.clientPort","2181");
>    System.out.println("Before Htable");
>     HTable table = new HTable(config, "rnc");
>     System.out.println("After Htable");
>
>      System.out.println("Before Get");
>    Get g = new Get(Bytes.toBytes("20100926000000P123TREDFR$#"));
>    Result r = table.get(g);
>    byte [] value = r.getValue(Bytes.toBytes("Info"),
>      Bytes.toBytes("COL_STAGE"));
>    // If we convert the value bytes, we should get back 'Some Value', the
>    // value we inserted at this location.
>    String valueStr = Bytes.toString(value);
>    System.out.println("GET: " + valueStr);
>
> *And here is the system Output*
>
>
> *Start*
> 10/10/29 02:05:46 WARN hbase.HBaseConfiguration: instantiating
> HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create()
> to construct a plain Configuration
> *Before Htable*
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:zookeeper.version=3.3.1-942149, built on 05/07/2010 17:14 GMT
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:host.name=DV
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.version=1.6.0_21
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.vendor=Sun Microsystems Inc.
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.home=C:\Program Files\Java\jdk1.6.0_21\jre
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.class.path=D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hbase-0.89.20100621+17.jar;D:\FreeLauncing\DataWareHouse\HBaseMRNewAPI\lib\hadoop-core-0.20.2+320.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\commons-logging-1.1.1.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\zookeeper-3.3.1+7.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\lib\log4j-1.2.15.jar;D:\FreeLauncing\DataWareHouse\HBaseClient\build\classes;D:\FreeLauncing\DataWareHouse\HBaseClient\src
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.library.path=C:\Program
> Files\Java\jdk1.6.0_21\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program
> Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\PC
> Connectivity
> Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program
> Files\Microsoft SQL Server\90\Tools\binn\;C:\Program
> Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL
> Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
> Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
> Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual
> Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Windows
> Live\Shared
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.io.tmpdir=C:\Users\shuja\AppData\Local\Temp\
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:java.compiler=<NA>
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows
> 7
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:os.version=6.1
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client environment:user.name
> =shuja
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:user.home=C:\Users\shuja
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Client
> environment:user.dir=D:\FreeLauncing\DataWareHouse\HBaseClient
> 10/10/29 02:05:47 INFO zookeeper.ZooKeeper: Initiating client connection,
> connectString=10.10.10.2:2181 sessionTimeout=60000
> watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@183f74d
> 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Opening socket connection to
> server /10.10.10.2:2181
> 10/10/29 02:05:47 INFO zookeeper.ClientCnxn: Socket connection established
> to app4.hsd1.wa.comcast.net/10.10.10.2:2181, initiating session
> 10/10/29 02:05:48 INFO zookeeper.ClientCnxn: Session establishment complete
> on server app4.hsd1.wa.comcast.net/10.10.10.2:2181, sessionid =
> 0x12bf232ec580014, negotiated timeout = 40000
>
>
> Can anybody tells why it is not proceeding???
> --
> Regards
> Shuja-ur-Rehman Baig
> http://pk.linkedin.com/in/shujamughal
> Cell: +92 3214207445
>