Install hbase in linux (hadoop is not required) and hbasehadoop
Hbase is a distributed, column-oriented (family) database. It is very common and involves a lot of information on the Internet. This article describes how to install hbase in linux. generally, hadoop must be installed before hbase is installed. however, for the sake of simplicity, you can also focus on hbase first regardless of hadoop.
0. Install jdk normally. The path is:
/usr/lib/jvm/java-8-openjdk-amd64
1. Download hbase-1.2.3-bin.tar.gz and decompress it.
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db$ pwd/home/ubuntu/taoge/hbase_dbubuntu@VM-0-15-ubuntu:~/taoge/hbase_db$ ls hbase-1.2.3 hbase-1.2.3-bin.tar.gz
2. Set JAVA_HOME as follows
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$ cat conf/hbase-env.sh | grep JAVA_HOME# export JAVA_HOME=/usr/java/jdk1.6.0/export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$
Then run the source command to make it take effect:
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$ source conf/hbase-env.shubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$
3. modify the configuration file as follows:
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$ cat conf/hbase-site.xml
hbase.rootdir
file:/home/ubuntu/taoge/hbase_db
hbase.zookeeper.property.dataDir
/home/ubuntu/taoge/hbase_db
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$
Add content in configuration and save it.
4. Change the PATH as follows:
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$ tail ~/.bashrc . /etc/bash_completion fifiexport HBASE_HOME=/home/ubuntu/taoge/hbase_db/hbase-1.2.3export HBASE_CONF_DIR=$HBASE_HOME/confexport BASE_CLASS_PATH=$HBASE_CONF_DIRexport PATH=$PATH:$HBASE_HOME/binubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$
The last four exports are newly added. Save the changes and perform the following operations:
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$ source ~/.bashrc ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$
You can see that the installation is successful:
ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$ hbase versionHBase 1.2.3Source code repository git://kalashnikov.att.net/Users/stack/checkouts/hbase.git.commit revision=bd63744624a26dc3350137b564fe746df7a721a4Compiled by stack on Mon Aug 29 15:13:42 PDT 2016From source with checksum 0ca49367ef6c3a680888bbc4f1485d18ubuntu@VM-0-15-ubuntu:~/taoge/hbase_db/hbase-1.2.3$
After the installation is complete, we will continue to introduce how to start and use hbase.