hbase 2.1 入门学习

1、环境准备

192.168.74.10  host196
192.168.74.29  host197
192.168.74.30  host198

  • [安装好zookeeper,jdk1.8,hadoop]

2、安装步骤

cd /opt
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/2.1.0/hbase-2.1.0-bin.tar.gz
tar -zxvf hbase-2.1.0-bin.tar.gz

环境变量

vi /etc/profile
#Hbase
export PATH=${HBASE_HOME}/bin:$PATH
export HBASE_HOME=/opt/hbase-2.1.0
source /etc/profile

cd /opt/hbase-2.1.0/conf
vi hbase-env.sh
export JAVA_HOME=/usr/local/jdk1.8.0_111
export HBASE_MANAGES_ZK=false

配置hbase-site.xml

vi hbase-site.xml
<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://host196:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>192.168.74.10:2181,192.168.74.29:2181,192.168.74.30:2181</value>
    </property>

</configuration>

配置regionservers

vi regionservers
host197
host198

配置backup-masters

vi backup-masters
host197

复制Hadoop配置文件hdfs-site.xml到HBase的conf目录

cp $HADOOP_HOME/etc/hadoop/hdfs-site.xml $HBASE_HOME/conf/

复制安装文件至从机器:

scp -r $HBASE_HOME host197:/opt
scp -r $HBASE_HOME host198:/opt

3、启动/停止服务

$HBASE_HOME/bin/start-hbase.sh
$HBASE_HOME/bin/stop-hbase.sh

访问:http://192.168.74.10:16010

4、简单测试

5、参考资料

1、HBase-2.1.0 集群搭建-(https://blog.csdn.net/qq_33857413/article/details/82868411) 2、安装配置HBase2.0.1集群-(https://blog.csdn.net/fishinhouse/article/details/81062272)

6、FAQ

1、可能会出现java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder的错误

解决方法:复制如下jar cp hadoop-2.7.2/share/hadoop/common/lib/htrace-core-3.1.0-incubating.jar $HBASE_HOME/lib

    原文作者:大奇的改变
    原文地址: https://www.jianshu.com/p/82fedb3b848a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞