You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Norbert Antunes <no...@gmail.com> on 2009/05/27 00:43:37 UTC
hbase shell scripting
Hi,
In the HBase shell wiki page it states the following:
"Your script can lean on the methods provided by the HBase Shell."
Can anyone provide a link or an example of how this would be done? I am
trying to write a script that will create 2 tables, but I have been
unsuccessful so far. I want to create a simple script so that I can
share the script with other members of my team. They would then be able
to run the script and the tables would be created automatically.
Is there an easy way to do this using hbase shell scripting?
Thanks.
Re: hbase shell scripting
Posted by Lars George <la...@worldlingo.com>.
Hi Norbert,
If you like you could check this out
http://www.larsgeorge.com/2009/05/hbase-schema-manager.html
I created a tool for exactly that purpose, i.e. create and maintain
tables across different clusters.
Lars
Norbert Antunes wrote:
> The first option worked.
>
> Thanks
>
> On Tue, May 26, 2009 at 6:52 PM, stack <st...@duboce.net> wrote:
>
>
>> Will this work for you?
>>
>> $ echo "create 'table1'" |./bin/hbase shell
>> $ echo "create 'table2'"|./bin/hbase shell
>>
>> or I was thinking that you could put the below into a script and run it:
>>
>> create 'table1'
>> create'table2'
>>
>> but looking at bin/hirb.rb, when you pass a script to shell to run,
>> most of the hbase aspects of the jirb shell have not been put up yet.
>> This we should fix. Meantime, study how ./bin/hirb.rb works and do
>> sufficient initialization in your own script or just write jruby using
>> the bin/hirb.rb content for example.
>>
>> Let me know if you'd like more help.
>>
>> St.Ack
>>
>>
>>
>> On Tue, May 26, 2009 at 3:43 PM, Norbert Antunes
>> <no...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> In the HBase shell wiki page it states the following:
>>>
>>> "Your script can lean on the methods provided by the HBase Shell."
>>>
>>> Can anyone provide a link or an example of how this would be done? I am
>>> trying to write a script that will create 2 tables, but I have been
>>> unsuccessful so far. I want to create a simple script so that I can
>>> share the script with other members of my team. They would then be able
>>> to run the script and the tables would be created automatically.
>>>
>>> Is there an easy way to do this using hbase shell scripting?
>>>
>>> Thanks.
>>>
>>>
>>>
>
>
Re: hbase shell scripting
Posted by Norbert Antunes <no...@gmail.com>.
The first option worked.
Thanks
On Tue, May 26, 2009 at 6:52 PM, stack <st...@duboce.net> wrote:
> Will this work for you?
>
> $ echo "create 'table1'" |./bin/hbase shell
> $ echo "create 'table2'"|./bin/hbase shell
>
> or I was thinking that you could put the below into a script and run it:
>
> create 'table1'
> create'table2'
>
> but looking at bin/hirb.rb, when you pass a script to shell to run,
> most of the hbase aspects of the jirb shell have not been put up yet.
> This we should fix. Meantime, study how ./bin/hirb.rb works and do
> sufficient initialization in your own script or just write jruby using
> the bin/hirb.rb content for example.
>
> Let me know if you'd like more help.
>
> St.Ack
>
>
>
> On Tue, May 26, 2009 at 3:43 PM, Norbert Antunes
> <no...@gmail.com> wrote:
> > Hi,
> >
> > In the HBase shell wiki page it states the following:
> >
> > "Your script can lean on the methods provided by the HBase Shell."
> >
> > Can anyone provide a link or an example of how this would be done? I am
> > trying to write a script that will create 2 tables, but I have been
> > unsuccessful so far. I want to create a simple script so that I can
> > share the script with other members of my team. They would then be able
> > to run the script and the tables would be created automatically.
> >
> > Is there an easy way to do this using hbase shell scripting?
> >
> > Thanks.
> >
> >
>
Re: hbase shell scripting
Posted by stack <st...@duboce.net>.
Will this work for you?
$ echo "create 'table1'" |./bin/hbase shell
$ echo "create 'table2'"|./bin/hbase shell
or I was thinking that you could put the below into a script and run it:
create 'table1'
create'table2'
but looking at bin/hirb.rb, when you pass a script to shell to run,
most of the hbase aspects of the jirb shell have not been put up yet.
This we should fix. Meantime, study how ./bin/hirb.rb works and do
sufficient initialization in your own script or just write jruby using
the bin/hirb.rb content for example.
Let me know if you'd like more help.
St.Ack
On Tue, May 26, 2009 at 3:43 PM, Norbert Antunes
<no...@gmail.com> wrote:
> Hi,
>
> In the HBase shell wiki page it states the following:
>
> "Your script can lean on the methods provided by the HBase Shell."
>
> Can anyone provide a link or an example of how this would be done? I am
> trying to write a script that will create 2 tables, but I have been
> unsuccessful so far. I want to create a simple script so that I can
> share the script with other members of my team. They would then be able
> to run the script and the tables would be created automatically.
>
> Is there an easy way to do this using hbase shell scripting?
>
> Thanks.
>
>