Ubuntu16.04下HBase安装笔记

基础准备

  • JDK
  • Hadoop
  • SSH Server

下载HBase

https://hbase.apache.org/

tar -zxvf hbase-1.4.2-bin.tar.gz
sudo mv hbase-1.4.2 /opt/hbase

系统环境变量

export HBASE_MANAGES_ZK=true
export HBASE_HOME=/opt/hbase
export PATH=$PATH:/opt/hbase/bin

写死JAVA_HOME

vi ./conf/hbase-env.sh

export JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre/

单机模式配置

vi hbase-site.xml

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>file:///tmp/hbase-${user.name}/hbase</value>
    </property>
</configuration>

伪分布模式配置

vi hbase-site.xml

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://localhost:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
</configuration>

启动Hadoop:

./start-all.sh

Hbase启停

启停:

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

查看进程:

jps

WEB控制台:
http://localhost:45005/master-status

HBase Shell

./bin/hbase shell
help

常用命令:

status
create 'test', 'cf'
list 'test'
describe 'test'

disable 'test'
drop 'test'
exists 'test'

put 'test', 'row1', 'cf:a', 'value1'
put 'test', 'row2', 'cf:b', 'value2'
put 'test', 'row3', 'cf:c', 'value3'

scan 'test'
get 'test', 'row1'

参考文档

https://www.jianshu.com/p/8818e8d40da4
https://www.jianshu.com/p/352213f109e5
https://www.shiyanlou.com/courses/37
https://www.ibm.com/developerworks/cn/analytics/library/ba-cn-bigdata-hbase/index.html

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 在吃饭时我和我妹妹有一些冲突,因为我是左撇子她是右撇子,我夹肉的时候她常常挡着我不让我吃肉,所以我的妈妈想了一个办...
    邢哲硕阅读 185评论 1 1
  • 喜欢“面朝大海,春暖花开”的感觉。若有美食相伴,那种感觉简直太幸福了…… 蘸鸭配薯条,牛肉蘸汁料,简单可口,让你一...
    悦读时刻阅读 299评论 0 0
  • 选择这个标题是因为此刻是凌晨3:30,涨奶严重,半边已是硬块且表皮发烫,触摸胀痛,躺下坠痛。刚给LG发完信...
    灵灵妈妈阅读 259评论 0 0
  • 我不喜欢颓废,然而我身边的室友,大学同学不思进取者居多,这是我来到大学之后非常伤心的事情,也是我后悔的事,讲真,来...
    幽九天独步阅读 221评论 2 1