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:
puts 'Issuing shutdown command now (y|N)? '
userin = gets.chomp
if userin == 'Y' or userin == 'y'
conf = HBaseConfiguration.create()
admin = HBaseAdmin.new(conf)
puts 'Shutdown issued, command runs asynchronously.'
puts 'Aborting shutdown.'
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.
On Jun 22, 2012, at 8:16 AM, AnandaVelMurugan Chandra Mohan wrote:
> 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!!