安装配置HBase2.0.1集群

1、配置ssh免密登录:

参考

2、下载HBase2.0.1文件:

wget http://mirrors.shu.edu.cn/apache/hbase/2.0.1/hbase-2.0.1-bin.tar.gz

3、配置hbase-env.sh

#开启JAVA_HOME配置
export JAVA_HOME=/usr/lib/jvm/java
#关闭HBase自带的zookeeper,使用zookeeper集群
export HBASE_MANAGES_ZK=false

4、配置hbase-site.xml

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://spr210:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>spr210:2181,spr211:2181,spr212:2181</value>
    </property>
</configuration>

5、配置regionservers(安装有Hadoop环境的集群)

spr210
spr213
spr214

6、配置backup-masters

vim backup-masters
spr210

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

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

8、复制配置文件到所有的regionservers服务器conf目录中

scp $HBASE_HOME/conf/*.* root@主机名:$HBASE_HOME/conf/

9、启动HBase

$HBASE_HOME/bin/start-hbase.sh

10、停止HBase

$HBASE_HOME/bin/stop-hbase.sh

11、查看HBase进程

HMaster

HRegionServer

12、默认Web UI端口16010

13、HBase Shell命令

hbase shell

#查看表
list
#新建表
create 'table-name','column-family'
#打开表
enable 'table-name'
#插入数据
put 'table-name','row-key','column-family:column','value'
#查看表全部数据
scan 'table-name'
#查看指定rowkey数据
get 'table-name','row-key'
#查看表结构
describe 'table-name'
#关闭表
disable 'table-name'
#删除表
drop 'table-name'

猜你喜欢

转载自blog.csdn.net/fishinhouse/article/details/81062272