我爱编程

玩转大数据之HBase

2017-07-09  本文已影响0人  编程回忆录

HBase版本:我们使用1.2.4的版本

HBase安装模式:

HBase安装:

tar zxvf hbase-1.2.4-bin.tar.gz
sudo vim /etc/hosts
hbase-2.png
cd hbase-1.2.4

设置HBase Home:

vim ~/.bash_profile
hbase-1.png

使.bash_profile配置立即生效

source ~/.bash_profile

进入配置文件目录:

cd conf

修改配置文件hbase-site.xml,配置如下内容:

<property>
        <name>hbase.rootdir</name>
        <value>hdfs://localhost:9000/hbase</value>
    </property>
    <property>
        <name>hbase.master</name>
        <value>localhost</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/Users/***/apps/data/hbase/zk-data</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>localhost</value>
    </property>
$HBASE_HOME/bin/start-hbase.sh &

jps检查相关进程是否正常启动:

jps -l
hbase-3.png
hbase shell
hbase-4.png

分别执行创建表、列出表、添加一条记录、扫描表和查询表的一行记录:

create 'test', 'cf'
list 'test'
put 'test', 'row1', 'cf:a', 'value1'
scan 'test'
get 'test', 'row1'
hbase-5.png

最后打开HBase Master管理页面:http://localhost:16010/master-status

hbase-6.png
上一篇 下一篇

猜你喜欢

热点阅读