HBase installation and use
1. Introduction to HBase
HBase is a distributed, column-oriented open source database, derived from a paper by Google "BigTable: a distributed storage system for structured data." HBase stores data in the form of a table. The table is composed of rows and columns, and the columns are divided into several column families / column families. For the official information of HBase, please visit [HBase Official Website] (http://hbase.apache.org/). There are three modes of operation of HBase: stand-alone mode, pseudo-distributed mode, and distributed mode. Stand-alone mode: HBase is installed and used on one computer without involving distributed storage of data; pseudo-distributed mode: a small cluster is simulated on one computer; distributed mode: using multiple computers to achieve physical Distributed storage. For learning purposes here, we only focus on the stand-alone mode and the pseudo-distributed mode.
Chiyu Oye All Rights Reserved Hahaha
Second, install and configure HBase
1.HBase installation
1.1 Use the tool filezilla to copy the HBase installation package hbase-1.1.2-bin.tar.gz to / usr / local
1.2 Use the command tar -zxvf hbase-1.1.2-bin.tar.gz, and then use the command mv hbase-1.1.2 hbase to rename it to hbase for easy operation
1.3 Configure environment variables
Use the command vi ~ / .bashrc, if you have not introduced PATH, please add the following content at the end of the ~ / .bashrc file:
export PATH=$PATH:/usr/local/hbase/bin
If PATH has been introduced, please append / usr / local / hbase / bin to the export PATH line, where ":" is the separator. As shown below:
Then use the command source ~ / .bashrc to make the environment variable configuration take effect
1.4 Add HBase permissions
Use the command chmod 777 ./hbase or chown -R localhost_xwj ./hbase to add operation permissions to the user, note that localhost_xwj is its own host name
1.5 View HBase version
Use the command / usr / local / hbase / bin / hbase version, as shown below
Seeing the above output message indicates that HBase has been successfully installed. Next, HBase stand-alone mode and pseudo-distributed mode will be configured separately.
2. HBase configuration
2.1 Single machine configuration skipped
2.2 Pseudo-distribution mode configuration
1. Configure /usr/local/hbase/conf/hbase-env.sh. The command is as follows:
2. Configure /usr/local/hbase/conf/hbase-site.xml to open and edit hbase-site.xml with the command vi, the command is as follows:
vi /usr/local/hbase/conf/hbase‐site.xml
3. Next, test and run HBase. The first step: first log in to ssh, before setting up a passwordless login, so no password is required here; then change the directory to / usr / local / hadoop; then start hadoop, if you have already started hadoop, skip this step. The command is as follows:
ssh localhost
cd /usr/local/hadoop
start‐dfs.sh
Step 2: Change directory to / usr / local / hbase; restart HBase. The command is as follows:
cd /usr/local/hbase
start‐hbase.sh
jps
Enter the shell interface:
4. Stop HBase, the command is as follows:
stop‐hbase.sh
Note: If an error occurs during the operation of HBase, you can view the cause of the error through the log file in the logs subdirectory under the {HBASE_HOME} directory (/ usr / local / hbase). The order of starting and closing Hadoop and HBase must be: start Hadoop—> start HBase—> close HBase—> close Hadoop