How to run java program

View: New views
12 Messages — Rating Filter:   Alert me  

How to run java program

by Liu Xianglong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now I run my java program in HMaster node, but I am wondering whether there are other ways to run java program, or need I copy my java program into server every time I want to run them?

Thanks!


Best Wishes!
_____________________________________________________________
 
刘祥龙  Liu Xianglong

Re: How to run java program

by Jonathan Gray-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not exactly sure what you are doing, but it is not intended that you
would copy any code into the HBase Master.

You can run client programs standalone, they just need to have the
proper jars in their classpath (hadoop, hbase, zookeeper, log4j).

JG

Liu Xianglong wrote:

> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now I run my java program in HMaster node, but I am wondering whether there are other ways to run java program, or need I copy my java program into server every time I want to run them?
>
> Thanks!
>
>
> Best Wishes!
> _____________________________________________________________
>  
> 刘祥龙  Liu Xianglong
>

Re: How to run java program

by Liu Xianglong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

would someone can answer my question? thanks a lot!

--------------------------------------------------
From: "Liu Xianglong" <sallonchina@...>
Sent: Monday, October 26, 2009 7:36 PM
To: <hbase-user@...>
Subject: How to run java program

> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now I
> run my java program in HMaster node, but I am wondering whether there are
> other ways to run java program, or need I copy my java program into server
> every time I want to run them?
>
> Thanks!
>
>
> Best Wishes!
> _____________________________________________________________
>
> 刘祥龙  Liu Xianglong
>

Re: How to run java program

by Tatsuya Kawano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Liu,

You didn't receive any email by some reason?
We have been trying to answer your question for a week.

http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
http://www.nabble.com/How-to-run-java-program-td26058149.html


So why don't you start to read above answers?

Thanks,

--
Tatsuya Kawano (Mr.)
Tokyo, Japan



2009/10/27 Liu Xianglong <sallonchina@...>:

> would someone can answer my question? thanks a lot!
>
> --------------------------------------------------
> From: "Liu Xianglong" <sallonchina@...>
> Sent: Monday, October 26, 2009 7:36 PM
> To: <hbase-user@...>
> Subject: How to run java program
>
>> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now I
>> run my java program in HMaster node, but I am wondering whether there are
>> other ways to run java program, or need I copy my java program into server
>> every time I want to run them?
>>
>> Thanks!
>>
>>
>> Best Wishes!
>> _____________________________________________________________
>>
>> 刘祥龙  Liu Xianglong

Re: How to run java program

by Liu Xianglong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Tatsuya Kawano. What does "add path to Test.class to hbase-env.sh under
conf directory" mean?

--------------------------------------------------
From: "Tatsuya Kawano" <tatsuyaml@...>
Sent: Tuesday, October 27, 2009 9:03 AM
To: <hbase-user@...>; <sallonchina@...>
Subject: Re: How to run java program

> Hi Liu,
>
> You didn't receive any email by some reason?
> We have been trying to answer your question for a week.
>
> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
> http://www.nabble.com/How-to-run-java-program-td26058149.html
>
>
> So why don't you start to read above answers?
>
> Thanks,
>
> --
> Tatsuya Kawano (Mr.)
> Tokyo, Japan
>
>
>
> 2009/10/27 Liu Xianglong <sallonchina@...>:
>> would someone can answer my question? thanks a lot!
>>
>> --------------------------------------------------
>> From: "Liu Xianglong" <sallonchina@...>
>> Sent: Monday, October 26, 2009 7:36 PM
>> To: <hbase-user@...>
>> Subject: How to run java program
>>
>>> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now
>>> I
>>> run my java program in HMaster node, but I am wondering whether there
>>> are
>>> other ways to run java program, or need I copy my java program into
>>> server
>>> every time I want to run them?
>>>
>>> Thanks!
>>>
>>>
>>> Best Wishes!
>>> _____________________________________________________________
>>>
>>> 刘祥龙  Liu Xianglong
>

Re: How to run java program

by Liu Xianglong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Now, I can run my program correctly if I add sentence
"config.set("hbase.master","<hmaster IP>:60000")", otherwise it will report
the error I mentioned in last emails. So what do you think about the
problem? Should I change some configuration? Now I do not add "hbase.master"
in hbase-site for full-distributed mode.
--------------------------------------------------
From: "Tatsuya Kawano" <tatsuyaml@...>
Sent: Tuesday, October 27, 2009 9:03 AM
To: <hbase-user@...>; <sallonchina@...>
Subject: Re: How to run java program

> Hi Liu,
>
> You didn't receive any email by some reason?
> We have been trying to answer your question for a week.
>
> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
> http://www.nabble.com/How-to-run-java-program-td26058149.html
>
>
> So why don't you start to read above answers?
>
> Thanks,
>
> --
> Tatsuya Kawano (Mr.)
> Tokyo, Japan
>
>
>
> 2009/10/27 Liu Xianglong <sallonchina@...>:
>> would someone can answer my question? thanks a lot!
>>
>> --------------------------------------------------
>> From: "Liu Xianglong" <sallonchina@...>
>> Sent: Monday, October 26, 2009 7:36 PM
>> To: <hbase-user@...>
>> Subject: How to run java program
>>
>>> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now
>>> I
>>> run my java program in HMaster node, but I am wondering whether there
>>> are
>>> other ways to run java program, or need I copy my java program into
>>> server
>>> every time I want to run them?
>>>
>>> Thanks!
>>>
>>>
>>> Best Wishes!
>>> _____________________________________________________________
>>>
>>> 刘祥龙  Liu Xianglong
>

Re: How to run java program

by 梁景明 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi , at first u should add the configure files in hbase to ur HBaseConfiguration
like this
conf.addResource("/hbase-site.xml");
and the file in ur hbase conf path.
if u change ur hbase conf ,just change it.




2009/10/27, Liu Xianglong <sallonchina@...>:

> Now, I can run my program correctly if I add sentence
> "config.set("hbase.master","<hmaster IP>:60000")", otherwise it will report
> the error I mentioned in last emails. So what do you think about the
> problem? Should I change some configuration? Now I do not add "hbase.master"
> in hbase-site for full-distributed mode.
> --------------------------------------------------
> From: "Tatsuya Kawano" <tatsuyaml@...>
> Sent: Tuesday, October 27, 2009 9:03 AM
> To: <hbase-user@...>; <sallonchina@...>
> Subject: Re: How to run java program
>
>> Hi Liu,
>>
>> You didn't receive any email by some reason?
>> We have been trying to answer your question for a week.
>>
>> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
>> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
>> http://www.nabble.com/How-to-run-java-program-td26058149.html
>>
>>
>> So why don't you start to read above answers?
>>
>> Thanks,
>>
>> --
>> Tatsuya Kawano (Mr.)
>> Tokyo, Japan
>>
>>
>>
>> 2009/10/27 Liu Xianglong <sallonchina@...>:
>>> would someone can answer my question? thanks a lot!
>>>
>>> --------------------------------------------------
>>> From: "Liu Xianglong" <sallonchina@...>
>>> Sent: Monday, October 26, 2009 7:36 PM
>>> To: <hbase-user@...>
>>> Subject: How to run java program
>>>
>>>> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now
>>>> I
>>>> run my java program in HMaster node, but I am wondering whether there
>>>> are
>>>> other ways to run java program, or need I copy my java program into
>>>> server
>>>> every time I want to run them?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>> Best Wishes!
>>>> _____________________________________________________________
>>>>
>>>> 刘祥龙  Liu Xianglong
>>
>

Re: How to run java program

by Tatsuya Kawano :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Tue, Oct 27, 2009 at 10:06 AM, Liu Xianglong <sallonchina@...> wrote:
> Sorry about that I haven't receive any reply. Thanks for you help, I will
> read them.

That's okay. You can check the mailing list archive if this happens again:
http://www.nabble.com/HBase-User-f34655.html


So, I'm a bit late to reply, but you have found a way to get your
program working; that's great!  As for "hbase-site.xml", please try
what 梁景明 said. (I'm forwarding the email just for sure.)

Also, are you running HBase 0.19? I would suggest to move to HBase
0.20.1, because there are lots of improvements in HBase 0.20. When you
use HBase 0.20.x, you no longer use "hbase.master", but
"hbase.zookeeper.quorum", so update your "hbase-site.xml". Take a look
at "hbase-default.xml", it has all the default properties including
"hbase.zookeeper.quorum".

Thanks,
Tatsuya

--
Tatsuya Kawano (Mr.)
Tokyo, Japan




On Tue, Oct 27, 2009 at 10:57 AM, 梁景明 <futureha@...> wrote:

> hi , at first u should add the configure files in hbase to ur HBaseConfiguration
> like this
> conf.addResource("/hbase-site.xml");
> and the file in ur hbase conf path.
> if u change ur hbase conf ,just change it.
>
>
>
>
> 2009/10/27, Liu Xianglong <sallonchina@...>:
>> Now, I can run my program correctly if I add sentence
>> "config.set("hbase.master","<hmaster IP>:60000")", otherwise it will report
>> the error I mentioned in last emails. So what do you think about the
>> problem? Should I change some configuration? Now I do not add "hbase.master"
>> in hbase-site for full-distributed mode.
>> --------------------------------------------------
>> From: "Tatsuya Kawano" <tatsuyaml@...>
>> Sent: Tuesday, October 27, 2009 9:03 AM
>> To: <hbase-user@...>; <sallonchina@...>
>> Subject: Re: How to run java program
>>
>>> Hi Liu,
>>>
>>> You didn't receive any email by some reason?
>>> We have been trying to answer your question for a week.
>>>
>>> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
>>> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
>>> http://www.nabble.com/How-to-run-java-program-td26058149.html
>>>
>>>
>>> So why don't you start to read above answers?
>>>
>>> Thanks,
>>>
>>> --
>>> Tatsuya Kawano (Mr.)
>>> Tokyo, Japan
>>>
>>>
>>>
>>> 2009/10/27 Liu Xianglong <sallonchina@...>:
>>>> would someone can answer my question? thanks a lot!
>>>>
>>>> --------------------------------------------------
>>>> From: "Liu Xianglong" <sallonchina@...>
>>>> Sent: Monday, October 26, 2009 7:36 PM
>>>> To: <hbase-user@...>
>>>> Subject: How to run java program
>>>>
>>>>> Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now
>>>>> I
>>>>> run my java program in HMaster node, but I am wondering whether there
>>>>> are
>>>>> other ways to run java program, or need I copy my java program into
>>>>> server
>>>>> every time I want to run them?
>>>>>
>>>>> Thanks!
>>>>>
>>>>>
>>>>> Best Wishes!
>>>>> _____________________________________________________________
>>>>>
>>>>> 刘祥龙  Liu Xianglong
>>>
>>
>

Re: How to run java program

by Liu Xianglong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks to 梁景明 and Tatsuya Kawano. I use HBase 0.20.0, I did follow what
梁景明 said, write my code as
    HBaseConfiguration config = new HBaseConfiguration();
    config.addResource("./conf/hbase-site.xml");
Then run it on my client PC. but it cann't work and get following message,
is my running way correct? or need something else be configured. Thanks
again.

09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:zookeeper.version=3.2.1-808558, built on 08/27/2009 18:48 GMT
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:host.name=node0
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.version=1.6.0_16
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.vendor=Sun Microsystems Inc.
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.home=/usr/java/jdk1.6.0_16/jre
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.class.path=/home/audr/eclipse/workspace/HBaseSimpleTest/bin:/home/audr/eclipse/workspace/HBaseTest/lib/caliph-emir-cbir.jar:/home/audr/eclipse/workspace/HBaseTest/lib/commons-logging-1.1.1.jar:/home/audr/eclipse/workspace/HBaseTest/lib/hadoop-0.20.1-core.jar:/home/audr/eclipse/workspace/HBaseTest/lib/hbase-0.20.0.jar:/home/audr/eclipse/workspace/HBaseTest/lib/Jama-1.0.2.jar:/home/audr/eclipse/workspace/HBaseTest/lib/log4j-1.2.15.jar:/home/audr/eclipse/workspace/HBaseTest/lib/metadata-extractor.jar:/home/audr/eclipse/workspace/HBaseTest/lib/zookeeper-3.2.1.jar
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.library.path=/usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/java/jdk1.6.0_16/jre/../lib/i386:/usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/lib/xulrunner-1.9:/usr/lib/xulrunner-1.9:/usr/java/packages/lib/i386:/lib:/usr/lib
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.io.tmpdir=/tmp
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:java.compiler=<NA>
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:os.arch=i386
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:os.version=2.6.18-128.el5
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:user.name=audr
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:user.home=/home/audr
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
environment:user.dir=/home/audr/eclipse/workspace/HBaseSimpleTest
09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Initiating client connection,
connectString=localhost:2181 sessionTimeout=60000
watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@13c6641
09/10/27 10:57:28 INFO zookeeper.ClientCnxn: zookeeper.disableAutoWatchReset
is false
09/10/27 10:57:28 INFO zookeeper.ClientCnxn: Attempting connection to server
localhost/127.0.0.1:2181
09/10/27 10:57:28 WARN zookeeper.ClientCnxn: Exception closing session 0x0
to sun.nio.ch.SelectionKeyImpl@1f4bcf7
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:933)



--------------------------------------------------
From: "Tatsuya Kawano" <tatsuyaml@...>
Sent: Tuesday, October 27, 2009 10:47 AM
To: <hbase-user@...>; <sallonchina@...>
Subject: Re: How to run java program

> Hi,
>
> On Tue, Oct 27, 2009 at 10:06 AM, Liu Xianglong <sallonchina@...>
> wrote:
>> Sorry about that I haven't receive any reply. Thanks for you help, I will
>> read them.
>
> That's okay. You can check the mailing list archive if this happens again:
> http://www.nabble.com/HBase-User-f34655.html
>
>
> So, I'm a bit late to reply, but you have found a way to get your
> program working; that's great!  As for "hbase-site.xml", please try
> what 梁景明 said. (I'm forwarding the email just for sure.)
>
> Also, are you running HBase 0.19? I would suggest to move to HBase
> 0.20.1, because there are lots of improvements in HBase 0.20. When you
> use HBase 0.20.x, you no longer use "hbase.master", but
> "hbase.zookeeper.quorum", so update your "hbase-site.xml". Take a look
> at "hbase-default.xml", it has all the default properties including
> "hbase.zookeeper.quorum".
>
> Thanks,
> Tatsuya
>
> --
> Tatsuya Kawano (Mr.)
> Tokyo, Japan
>
>
>
>
> On Tue, Oct 27, 2009 at 10:57 AM, 梁景明 <futureha@...> wrote:
>> hi , at first u should add the configure files in hbase to ur
>> HBaseConfiguration
>> like this
>> conf.addResource("/hbase-site.xml");
>> and the file in ur hbase conf path.
>> if u change ur hbase conf ,just change it.
>>
>>
>>
>>
>> 2009/10/27, Liu Xianglong <sallonchina@...>:
>>> Now, I can run my program correctly if I add sentence
>>> "config.set("hbase.master","<hmaster IP>:60000")", otherwise it will
>>> report
>>> the error I mentioned in last emails. So what do you think about the
>>> problem? Should I change some configuration? Now I do not add
>>> "hbase.master"
>>> in hbase-site for full-distributed mode.
>>> --------------------------------------------------
>>> From: "Tatsuya Kawano" <tatsuyaml@...>
>>> Sent: Tuesday, October 27, 2009 9:03 AM
>>> To: <hbase-user@...>; <sallonchina@...>
>>> Subject: Re: How to run java program
>>>
>>>> Hi Liu,
>>>>
>>>> You didn't receive any email by some reason?
>>>> We have been trying to answer your question for a week.
>>>>
>>>> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
>>>> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
>>>> http://www.nabble.com/How-to-run-java-program-td26058149.html
>>>>
>>>>
>>>> So why don't you start to read above answers?
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> Tatsuya Kawano (Mr.)
>>>> Tokyo, Japan
>>>>
>>>>
>>>>
>>>> 2009/10/27 Liu Xianglong <sallonchina@...>:
>>>>> would someone can answer my question? thanks a lot!
>>>>>
>>>>> --------------------------------------------------
>>>>> From: "Liu Xianglong" <sallonchina@...>
>>>>> Sent: Monday, October 26, 2009 7:36 PM
>>>>> To: <hbase-user@...>
>>>>> Subject: How to run java program
>>>>>
>>>>>> Hi, everyone. I am using HBase Java API to retrieve data in HTable.
>>>>>> Now
>>>>>> I
>>>>>> run my java program in HMaster node, but I am wondering whether there
>>>>>> are
>>>>>> other ways to run java program, or need I copy my java program into
>>>>>> server
>>>>>> every time I want to run them?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>>
>>>>>> Best Wishes!
>>>>>> _____________________________________________________________
>>>>>>
>>>>>> 刘祥龙  Liu Xianglong
>>>>
>>>
>>
>

Re: How to run java program

by Amandeep Khurana :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Comment Inline

On Mon, Oct 26, 2009 at 8:00 PM, Liu Xianglong <sallonchina@...>wrote:

> Thanks to 梁景明 and Tatsuya Kawano. I use HBase 0.20.0, I did follow what 梁景明
> said, write my code as
>   HBaseConfiguration config = new HBaseConfiguration();
>   config.addResource("./conf/hbase-site.xml");
> Then run it on my client PC. but it cann't work and get following message,
> is my running way correct? or need something else be configured. Thanks
> again.
>
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:zookeeper.version=3.2.1-808558, built on 08/27/2009 18:48 GMT
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:host.name
> =node0
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.version=1.6.0_16
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.vendor=Sun Microsystems Inc.
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.home=/usr/java/jdk1.6.0_16/jre
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.class.path=/home/audr/eclipse/workspace/HBaseSimpleTest/bin:/home/audr/eclipse/workspace/HBaseTest/lib/caliph-emir-cbir.jar:/home/audr/eclipse/workspace/HBaseTest/lib/commons-logging-1.1.1.jar:/home/audr/eclipse/workspace/HBaseTest/lib/hadoop-0.20.1-core.jar:/home/audr/eclipse/workspace/HBaseTest/lib/hbase-0.20.0.jar:/home/audr/eclipse/workspace/HBaseTest/lib/Jama-1.0.2.jar:/home/audr/eclipse/workspace/HBaseTest/lib/log4j-1.2.15.jar:/home/audr/eclipse/workspace/HBaseTest/lib/metadata-extractor.jar:/home/audr/eclipse/workspace/HBaseTest/lib/zookeeper-3.2.1.jar
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.library.path=/usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/java/jdk1.6.0_16/jre/../lib/i386:/usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/lib/xulrunner-1.9:/usr/lib/xulrunner-1.9:/usr/java/packages/lib/i386:/lib:/usr/lib
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.io.tmpdir=/tmp
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:java.compiler=<NA>
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:os.name
> =Linux
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:os.arch=i386
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:os.version=2.6.18-128.el5
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:user.name
> =audr
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:user.home=/home/audr
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
> environment:user.dir=/home/audr/eclipse/workspace/HBaseSimpleTest
> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Initiating client connection,
> connectString=localhost:2181 sessionTimeout=60000
> watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@13c6641
> 09/10/27 10:57:28 INFO zookeeper.ClientCnxn:
> zookeeper.disableAutoWatchReset is false
> 09/10/27 10:57:28 INFO zookeeper.ClientCnxn: Attempting connection to
> server localhost/127.0.0.1:2181
>

Are you running zk on the node you are trying to run this code from? It
should not be saying localhost otherwise...

Also, set the zookeeper quorum instead of the hbase master and try again.
What you can also do is include in your classpath a directory which contains
the hbase-site.xml, hadoop-site.xml and zoo.cfg files. That ways you wont
need to set any config parameter in your code. The HBaseConfiguration will
automatically pick it up from the environment.


09/10/27 10:57:28 WARN zookeeper.ClientCnxn: Exception closing session 0x0

> to sun.nio.ch.SelectionKeyImpl@1f4bcf7
> java.net.ConnectException: Connection refused
>        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>        at
> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
>        at
> org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:933)
>
>
>
>
> --------------------------------------------------
> From: "Tatsuya Kawano" <tatsuyaml@...>
> Sent: Tuesday, October 27, 2009 10:47 AM
>
> To: <hbase-user@...>; <sallonchina@...>
> Subject: Re: How to run java program
>
>  Hi,
>>
>> On Tue, Oct 27, 2009 at 10:06 AM, Liu Xianglong <sallonchina@...>
>> wrote:
>>
>>> Sorry about that I haven't receive any reply. Thanks for you help, I will
>>> read them.
>>>
>>
>> That's okay. You can check the mailing list archive if this happens again:
>> http://www.nabble.com/HBase-User-f34655.html
>>
>>
>> So, I'm a bit late to reply, but you have found a way to get your
>> program working; that's great!  As for "hbase-site.xml", please try
>> what 梁景明 said. (I'm forwarding the email just for sure.)
>>
>> Also, are you running HBase 0.19? I would suggest to move to HBase
>> 0.20.1, because there are lots of improvements in HBase 0.20. When you
>> use HBase 0.20.x, you no longer use "hbase.master", but
>> "hbase.zookeeper.quorum", so update your "hbase-site.xml". Take a look
>> at "hbase-default.xml", it has all the default properties including
>> "hbase.zookeeper.quorum".
>>
>> Thanks,
>> Tatsuya
>>
>> --
>> Tatsuya Kawano (Mr.)
>> Tokyo, Japan
>>
>>
>>
>>
>> On Tue, Oct 27, 2009 at 10:57 AM, 梁景明 <futureha@...> wrote:
>>
>>> hi , at first u should add the configure files in hbase to ur
>>> HBaseConfiguration
>>> like this
>>> conf.addResource("/hbase-site.xml");
>>> and the file in ur hbase conf path.
>>> if u change ur hbase conf ,just change it.
>>>
>>>
>>>
>>>
>>> 2009/10/27, Liu Xianglong <sallonchina@...>:
>>>
>>>> Now, I can run my program correctly if I add sentence
>>>> "config.set("hbase.master","<hmaster IP>:60000")", otherwise it will
>>>> report
>>>> the error I mentioned in last emails. So what do you think about the
>>>> problem? Should I change some configuration? Now I do not add
>>>> "hbase.master"
>>>> in hbase-site for full-distributed mode.
>>>> --------------------------------------------------
>>>> From: "Tatsuya Kawano" <tatsuyaml@...>
>>>> Sent: Tuesday, October 27, 2009 9:03 AM
>>>> To: <hbase-user@...>; <sallonchina@...>
>>>> Subject: Re: How to run java program
>>>>
>>>>  Hi Liu,
>>>>>
>>>>> You didn't receive any email by some reason?
>>>>> We have been trying to answer your question for a week.
>>>>>
>>>>> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
>>>>>
>>>>> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
>>>>> http://www.nabble.com/How-to-run-java-program-td26058149.html
>>>>>
>>>>>
>>>>> So why don't you start to read above answers?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> --
>>>>> Tatsuya Kawano (Mr.)
>>>>> Tokyo, Japan
>>>>>
>>>>>
>>>>>
>>>>> 2009/10/27 Liu Xianglong <sallonchina@...>:
>>>>>
>>>>>> would someone can answer my question? thanks a lot!
>>>>>>
>>>>>> --------------------------------------------------
>>>>>> From: "Liu Xianglong" <sallonchina@...>
>>>>>> Sent: Monday, October 26, 2009 7:36 PM
>>>>>> To: <hbase-user@...>
>>>>>> Subject: How to run java program
>>>>>>
>>>>>>  Hi, everyone. I am using HBase Java API to retrieve data in HTable.
>>>>>>> Now
>>>>>>> I
>>>>>>> run my java program in HMaster node, but I am wondering whether there
>>>>>>> are
>>>>>>> other ways to run java program, or need I copy my java program into
>>>>>>> server
>>>>>>> every time I want to run them?
>>>>>>>
>>>>>>> Thanks!
>>>>>>>
>>>>>>>
>>>>>>> Best Wishes!
>>>>>>> _____________________________________________________________
>>>>>>>
>>>>>>> 刘祥龙  Liu Xianglong
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>

Re: How to run java program

by Liu Xianglong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, Amandeep Khurana. Great, it works.

--------------------------------------------------
From: "Amandeep Khurana" <amansk@...>
Sent: Tuesday, October 27, 2009 11:34 AM
To: <hbase-user@...>
Subject: Re: How to run java program

> Comment Inline
>
> On Mon, Oct 26, 2009 at 8:00 PM, Liu Xianglong
> <sallonchina@...>wrote:
>
>> Thanks to 梁景明 and Tatsuya Kawano. I use HBase 0.20.0, I did follow
>> what 梁景明
>> said, write my code as
>>   HBaseConfiguration config = new HBaseConfiguration();
>>   config.addResource("./conf/hbase-site.xml");
>> Then run it on my client PC. but it cann't work and get following
>> message,
>> is my running way correct? or need something else be configured. Thanks
>> again.
>>
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:zookeeper.version=3.2.1-808558, built on 08/27/2009 18:48 GMT
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:host.name
>> =node0
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.version=1.6.0_16
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.vendor=Sun Microsystems Inc.
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.home=/usr/java/jdk1.6.0_16/jre
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.class.path=/home/audr/eclipse/workspace/HBaseSimpleTest/bin:/home/audr/eclipse/workspace/HBaseTest/lib/caliph-emir-cbir.jar:/home/audr/eclipse/workspace/HBaseTest/lib/commons-logging-1.1.1.jar:/home/audr/eclipse/workspace/HBaseTest/lib/hadoop-0.20.1-core.jar:/home/audr/eclipse/workspace/HBaseTest/lib/hbase-0.20.0.jar:/home/audr/eclipse/workspace/HBaseTest/lib/Jama-1.0.2.jar:/home/audr/eclipse/workspace/HBaseTest/lib/log4j-1.2.15.jar:/home/audr/eclipse/workspace/HBaseTest/lib/metadata-extractor.jar:/home/audr/eclipse/workspace/HBaseTest/lib/zookeeper-3.2.1.jar
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.library.path=/usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/java/jdk1.6.0_16/jre/../lib/i386:/usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/lib/xulrunner-1.9:/usr/lib/xulrunner-1.9:/usr/java/packages/lib/i386:/lib:/usr/lib
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.io.tmpdir=/tmp
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:java.compiler=<NA>
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:os.name
>> =Linux
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:os.arch=i386
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:os.version=2.6.18-128.el5
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client environment:user.name
>> =audr
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:user.home=/home/audr
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Client
>> environment:user.dir=/home/audr/eclipse/workspace/HBaseSimpleTest
>> 09/10/27 10:57:28 INFO zookeeper.ZooKeeper: Initiating client connection,
>> connectString=localhost:2181 sessionTimeout=60000
>> watcher=org.apache.hadoop.hbase.client.HConnectionManager$ClientZKWatcher@13c6641
>> 09/10/27 10:57:28 INFO zookeeper.ClientCnxn:
>> zookeeper.disableAutoWatchReset is false
>> 09/10/27 10:57:28 INFO zookeeper.ClientCnxn: Attempting connection to
>> server localhost/127.0.0.1:2181
>>
>
> Are you running zk on the node you are trying to run this code from? It
> should not be saying localhost otherwise...
>
> Also, set the zookeeper quorum instead of the hbase master and try again.
> What you can also do is include in your classpath a directory which
> contains
> the hbase-site.xml, hadoop-site.xml and zoo.cfg files. That ways you wont
> need to set any config parameter in your code. The HBaseConfiguration will
> automatically pick it up from the environment.
>
>
> 09/10/27 10:57:28 WARN zookeeper.ClientCnxn: Exception closing session 0x0
>> to sun.nio.ch.SelectionKeyImpl@1f4bcf7
>> java.net.ConnectException: Connection refused
>>        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>>        at
>> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
>>        at
>> org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:933)
>>
>>
>>
>>
>> --------------------------------------------------
>> From: "Tatsuya Kawano" <tatsuyaml@...>
>> Sent: Tuesday, October 27, 2009 10:47 AM
>>
>> To: <hbase-user@...>; <sallonchina@...>
>> Subject: Re: How to run java program
>>
>>  Hi,
>>>
>>> On Tue, Oct 27, 2009 at 10:06 AM, Liu Xianglong
>>> <sallonchina@...>
>>> wrote:
>>>
>>>> Sorry about that I haven't receive any reply. Thanks for you help, I
>>>> will
>>>> read them.
>>>>
>>>
>>> That's okay. You can check the mailing list archive if this happens
>>> again:
>>> http://www.nabble.com/HBase-User-f34655.html
>>>
>>>
>>> So, I'm a bit late to reply, but you have found a way to get your
>>> program working; that's great!  As for "hbase-site.xml", please try
>>> what 梁景明 said. (I'm forwarding the email just for sure.)
>>>
>>> Also, are you running HBase 0.19? I would suggest to move to HBase
>>> 0.20.1, because there are lots of improvements in HBase 0.20. When you
>>> use HBase 0.20.x, you no longer use "hbase.master", but
>>> "hbase.zookeeper.quorum", so update your "hbase-site.xml". Take a look
>>> at "hbase-default.xml", it has all the default properties including
>>> "hbase.zookeeper.quorum".
>>>
>>> Thanks,
>>> Tatsuya
>>>
>>> --
>>> Tatsuya Kawano (Mr.)
>>> Tokyo, Japan
>>>
>>>
>>>
>>>
>>> On Tue, Oct 27, 2009 at 10:57 AM, 梁景明 <futureha@...> wrote:
>>>
>>>> hi , at first u should add the configure files in hbase to ur
>>>> HBaseConfiguration
>>>> like this
>>>> conf.addResource("/hbase-site.xml");
>>>> and the file in ur hbase conf path.
>>>> if u change ur hbase conf ,just change it.
>>>>
>>>>
>>>>
>>>>
>>>> 2009/10/27, Liu Xianglong <sallonchina@...>:
>>>>
>>>>> Now, I can run my program correctly if I add sentence
>>>>> "config.set("hbase.master","<hmaster IP>:60000")", otherwise it will
>>>>> report
>>>>> the error I mentioned in last emails. So what do you think about the
>>>>> problem? Should I change some configuration? Now I do not add
>>>>> "hbase.master"
>>>>> in hbase-site for full-distributed mode.
>>>>> --------------------------------------------------
>>>>> From: "Tatsuya Kawano" <tatsuyaml@...>
>>>>> Sent: Tuesday, October 27, 2009 9:03 AM
>>>>> To: <hbase-user@...>; <sallonchina@...>
>>>>> Subject: Re: How to run java program
>>>>>
>>>>>  Hi Liu,
>>>>>>
>>>>>> You didn't receive any email by some reason?
>>>>>> We have been trying to answer your question for a week.
>>>>>>
>>>>>> http://www.nabble.com/Qustion-about-HBase-error-td25969212.html
>>>>>>
>>>>>> http://www.nabble.com/java-api-error%3A-connection-to-HMaster-td25976824.html
>>>>>> http://www.nabble.com/How-to-run-java-program-td26058149.html
>>>>>>
>>>>>>
>>>>>> So why don't you start to read above answers?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> --
>>>>>> Tatsuya Kawano (Mr.)
>>>>>> Tokyo, Japan
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2009/10/27 Liu Xianglong <sallonchina@...>:
>>>>>>
>>>>>>> would someone can answer my question? thanks a lot!
>>>>>>>
>>>>>>> --------------------------------------------------
>>>>>>> From: "Liu Xianglong" <sallonchina@...>
>>>>>>> Sent: Monday, October 26, 2009 7:36 PM
>>>>>>> To: <hbase-user@...>
>>>>>>> Subject: How to run java program
>>>>>>>
>>>>>>>  Hi, everyone. I am using HBase Java API to retrieve data in HTable.
>>>>>>>> Now
>>>>>>>> I
>>>>>>>> run my java program in HMaster node, but I am wondering whether
>>>>>>>> there
>>>>>>>> are
>>>>>>>> other ways to run java program, or need I copy my java program into
>>>>>>>> server
>>>>>>>> every time I want to run them?
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>>
>>>>>>>>
>>>>>>>> Best Wishes!
>>>>>>>> _____________________________________________________________
>>>>>>>>
>>>>>>>> 刘祥龙  Liu Xianglong
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>

Re: How to run java program

by Doss_IPH :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,
This is a small application which I have developed that can be run on tomcat or JBoss.
It is quit easy.

This project is available in NetBeans Project format.

You can find it from this link..
 HBase small application 

In this URL you can find out IPH-HBase download link.

Get the project and load it in Netbeans as a web based project with libraries of hadoop-0.19.0 and hbase-0.19.3 versions in the class path.

MySQL library is also available inside of zip. This library helps to import data from MySQL to HTable.

Before running this application you have to set few parameters in the source code. That I have mentioned in the document.

Make sure that hadoop and Hbase server should be running before running the application.

This is sample application only. Do not take it for real time...

If any doubt is in this link, I expect your feedback of this.

It is absolutely free....

Thanks
Arockia Doss
Intellipowerhive solutions
doss@intellipowerhive.com


Liu Xianglong wrote:
Hi, everyone. I am using HBase Java API to retrieve data in HTable. Now I run my java program in HMaster node, but I am wondering whether there are other ways to run java program, or need I copy my java program into server every time I want to run them?

Thanks!


Best Wishes!
_____________________________________________________________
 
刘祥龙  Liu Xianglong