You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by AnandaVelMurugan Chandra Mohan <an...@gmail.com> on 2012/06/22 08:16:24 UTC

Stopping Hbase

Hi,

Can I stop Hbase from any node in the cluster? We have a three node cluster
and owner of two nodes is out of office. I have access to only one node
now. Zookeeper is running in one of the two non-accessible nodes. Can I run
<HBASE_HOME>/bin/stop-hbase.h in my node?. Will HBase stop with no issues?
Please suggest. Thanks!!

-- 
Regards,
Anand

Re: Stopping Hbase

Posted by AnandaVelMurugan Chandra Mohan <an...@gmail.com>.
Hi,

I dont have ssh credentials to access master node. So I want to stop Hbase
cluster from region server node. Is it possible?



On Fri, Jun 22, 2012 at 12:34 PM, Mohammad Tariq <do...@gmail.com> wrote:

> You can ssh into that machine and stop the Hbase.
>
> Regards,
>     Mohammad Tariq
>
>
> On Fri, Jun 22, 2012 at 11:46 AM, AnandaVelMurugan Chandra Mohan
> <an...@gmail.com> wrote:
> > Hi,
> >
> > Can I stop Hbase from any node in the cluster? We have a three node
> cluster
> > and owner of two nodes is out of office. I have access to only one node
> > now. Zookeeper is running in one of the two non-accessible nodes. Can I
> run
> > <HBASE_HOME>/bin/stop-hbase.h in my node?. Will HBase stop with no
> issues?
> > Please suggest. Thanks!!
> >
> > --
> > Regards,
> > Anand
>



-- 
Regards,
Anand

Re: Stopping Hbase

Posted by Mohammad Tariq <do...@gmail.com>.
You can ssh into that machine and stop the Hbase.

Regards,
    Mohammad Tariq


On Fri, Jun 22, 2012 at 11:46 AM, AnandaVelMurugan Chandra Mohan
<an...@gmail.com> wrote:
> Hi,
>
> Can I stop Hbase from any node in the cluster? We have a three node cluster
> and owner of two nodes is out of office. I have access to only one node
> now. Zookeeper is running in one of the two non-accessible nodes. Can I run
> <HBASE_HOME>/bin/stop-hbase.h in my node?. Will HBase stop with no issues?
> Please suggest. Thanks!!
>
> --
> Regards,
> Anand

Re: Stopping Hbase

Posted by AnandaVelMurugan Chandra Mohan <an...@gmail.com>.
Hi Lars,

Thanks for detailed response. I will check this.

On Fri, Jun 22, 2012 at 12:49 PM, Lars George <la...@gmail.com> wrote:

> Hi Anand,
>
> The stop-hbase.sh needs two things a) the list of hostnames in the
> conf/regionservers file and b) ssh access to all machines. The script then
> iterates over that list and sends the "hbase regionserver stop" command to
> each machine using ssh.
>
> In the past we had a shell command that could shutdown the cluster, but
> since there was an issue that "help shutdown" was actually running both
> command and stop the cluster, it was removed (
> https://issues.apache.org/jira/browse/HBASE-3249). You could add it back
> into your JRuby code - but that would mean patching your HBase instance.
> Another option is to write this as a separate JRuby script like so:
>
>
> include Java
> import org.apache.hadoop.hbase.HBaseConfiguration
> import org.apache.hadoop.hbase.client.HBaseAdmin
>
> puts 'Issuing shutdown command now (y|N)? '
> userin = gets.chomp
> if userin == 'Y' or userin == 'y'
>  conf = HBaseConfiguration.create()
>  admin = HBaseAdmin.new(conf)
>  admin.shutdown()
>  puts 'Shutdown issued, command runs asynchronously.'
> else
>  puts 'Aborting shutdown.'
> end
>
> puts 'Done.'
>
>
> Save this in a file called shutdown_cluster.rb and invoke it from the
> machine you have access to like so:
>
> $ bin/hbase org.jruby.Main shutdown_cluster.rb
>
> and follow the prompts.
>
> Godspeed :)
>
> Cheers,
> Lars
>
>
> On Jun 22, 2012, at 8:16 AM, AnandaVelMurugan Chandra Mohan wrote:
>
> > Hi,
> >
> > Can I stop Hbase from any node in the cluster? We have a three node
> cluster
> > and owner of two nodes is out of office. I have access to only one node
> > now. Zookeeper is running in one of the two non-accessible nodes. Can I
> run
> > <HBASE_HOME>/bin/stop-hbase.h in my node?. Will HBase stop with no
> issues?
> > Please suggest. Thanks!!
> >
> > --
> > Regards,
> > Anand
>
>


-- 
Regards,
Anand

Re: Stopping Hbase

Posted by Lars George <la...@gmail.com>.
Hi Anand,

The stop-hbase.sh needs two things a) the list of hostnames in the conf/regionservers file and b) ssh access to all machines. The script then iterates over that list and sends the "hbase regionserver stop" command to each machine using ssh. 

In the past we had a shell command that could shutdown the cluster, but since there was an issue that "help shutdown" was actually running both command and stop the cluster, it was removed (https://issues.apache.org/jira/browse/HBASE-3249). You could add it back into your JRuby code - but that would mean patching your HBase instance. Another option is to write this as a separate JRuby script like so:


include Java
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.HBaseAdmin

puts 'Issuing shutdown command now (y|N)? '
userin = gets.chomp
if userin == 'Y' or userin == 'y'
  conf = HBaseConfiguration.create()
  admin = HBaseAdmin.new(conf) 
  admin.shutdown()  
  puts 'Shutdown issued, command runs asynchronously.'
else 
  puts 'Aborting shutdown.'
end

puts 'Done.'


Save this in a file called shutdown_cluster.rb and invoke it from the machine you have access to like so:

$ bin/hbase org.jruby.Main shutdown_cluster.rb 

and follow the prompts. 

Godspeed :)

Cheers,
Lars


On Jun 22, 2012, at 8:16 AM, AnandaVelMurugan Chandra Mohan wrote:

> Hi,
> 
> Can I stop Hbase from any node in the cluster? We have a three node cluster
> and owner of two nodes is out of office. I have access to only one node
> now. Zookeeper is running in one of the two non-accessible nodes. Can I run
> <HBASE_HOME>/bin/stop-hbase.h in my node?. Will HBase stop with no issues?
> Please suggest. Thanks!!
> 
> -- 
> Regards,
> Anand