#下载hbase
wget https://mirrors.cnnic.cn/apache/hbase/2.1.1/hbase-2.1.1-bin.tar.gz
#下载jdk1.8
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
#上传jdk
rz -bye
#解压jdk和hbase
tar -zxvf jdk-8u191-linux-x64.tar.gz
tar -zxvf hbase-2.1.1-bin.tar.gz
#配置hbase环境变量
vi /etc/profile
export HBASE_HOME=/home/hbase-2.1.1
export PATH=$PATH:$HBASE_HOME/bin
source /etc/profile
vi /home/hbase-2.1.1/conf/hbase-env.sh
export JAVA_HOME=/home/jdk1.8.0_191
export HBASE_CLASSPATH=/home/hbase-2.1.1/conf
export HBASE_MANAGES_ZK=true
#修改hbase-site.xml
vi /home/hbase-2.1.1/conf/hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/hbase-2.1.1/logs/site</value>
</property>
<property>
<name>hbase.tmp.dir</name>
<value>/home/hbase-2.1.1/tmp</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>lfwer</value>
</property>
</configuration>
#查看hbase是否安装成功
hbase version
#启动hbase
/home/hbase-2.1.1/conf/.start-hbase.sh
#用hbase shell 访问一下
hbase shell
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.1.1, rb60a92d6864ef27295027f5961cb46f9162d7637, Fri Oct 26 19:27:03 PDT 2018
Took 0.0020 seconds
hbase(main):001:0>
hbase(main):002:0*
#执行list命令
hbase(main):002:0* list
TABLE
test
1 row(s)
Took 0.3306 seconds
=> ["test"]
hbase(main):003:0>
#通过浏览器查看hbase状态信息
http://ip:16030
本文详细介绍了如何从零开始安装HBase,包括下载HBase和JDK,配置环境变量,修改配置文件,以及启动和验证HBase是否正确安装的过程。
1036

被折叠的 条评论
为什么被折叠?



