HBase Tutorial
HBase Resources
Selected Reading
- HBase - Security
- HBase - Count & Truncate
- HBase - Scan
- HBase - Delete Data
- HBase - Read Data
- HBase - Update Data
- HBase - Create Data
- HBase - Client API
- HBase - Shutting Down
- HBase - Drop a Table
- HBase - Exists
- HBase - Describe & Alter
- HBase - Enabling a Table
- HBase - Disabling a Table
- HBase - Listing Table
- HBase - Create Table
- HBase - Admin API
- HBase - General Commands
- HBase - Shell
- HBase - Installation
- HBase - Architecture
- HBase - Overview
- HBase - Home
HBase Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
HBase - Shutting Down
HBase - Shutting Down
exit
You exit the shell by typing the exit command.
hbase(main):021:0> exit
Stopping HBase
To stop HBase, browse to the HBase home folder and type the following command.
./bin/stop-hbase.sh
Stopping HBase Using Java API
You can shut down the HBase using the shutdown() method of the HBaseAdmin class. Follow the steps given below to shut down HBase:
Step 1
Instantiate the HbaseAdmin class.
// Instantiating configuration object Configuration conf = HBaseConfiguration.create(); // Instantiating HBaseAdmin object HBaseAdmin admin = new HBaseAdmin(conf);
Step 2
Shut down the HBase using the shutdown() method of the HBaseAdmin class.
admin.shutdown();
Given below is the program to stop the HBase.
import java.io.IOException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.cpent.HBaseAdmin; pubpc class ShutDownHbase{ pubpc static void main(String args[])throws IOException { // Instantiating configuration class Configuration conf = HBaseConfiguration.create(); // Instantiating HBaseAdmin class HBaseAdmin admin = new HBaseAdmin(conf); // Shutting down HBase System.out.println("Shutting down hbase"); admin.shutdown(); } }
Compile and execute the above program as shown below.
$javac ShutDownHbase.java $java ShutDownHbase
The following should be the output:
Shutting down hbaseAdvertisements