码迷,mamicode.com
首页 > 其他好文 > 详细

Hadoop 单机搭建 Hbase单机模式搭建

时间:2020-03-19 17:51:45      阅读:58      评论:0      收藏:0      [点我收藏+]

标签:自带   java_home   tfs   hba   and   data   png   idt   seconds   

Hbase官网下载地址:https://hbase.apache.org

本案例使用:hbase-2.1.9-bin.tar.gz

一、上传并解压安装包

1、将hbase-2.1.9-bin.tar.gz文件上传到/opt/softwares/文件夹

2、解压

tar -zxf /opt/softwares/hbase-2.1.9-bin.tar.gz -C /opt/modules/

 

二、hbase-env.sh 文件配置

修改hbase安装目录下的conf/hbase-env.sh,配置关联的JDK ( /opt/modules/hbase-2.1.9/conf )

export JAVA_HOME=/opt/modules/jdk1.8.0_181

  #启动自带的zookeeper

  export HBASE_MANAGES_ZK=true

 

三、hbase-site.xml 文件配置

修改hbase安装目录下的conf/hbase-site.xml,配置关联的JDK ( /opt/modules/hbase-2.1.9/conf ),创建临时目录 

mkdir /opt/modules/hbase-2.1.9/tmp
技术图片
<configuration>
   <!-- 用来持久化HBase  需要与hadoop core-site.xml 中fs.defaultFS 一致 -->
   <property>
        <name>hbase.rootdir</name>
        <value>file:///home/hadoop/hbase</value>
    </property>  
<!-- ZooKeeper的zoo.conf中的配置。 快照的存储位置 --> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/hadoop/zookeeper</value>
</property>
   <!-- 本地文件系统的临时文件夹。可以修改到一个更为持久的目录上。(/tmp会在重启时清除) --> 
<property> <name>hbase.tmp.dir</name> <value>/opt/modules/hbase-2.1.9/tmp</value> </property>
</configuration>
技术图片

 

四、启动hbase

[hadoop@centos01 bin]$ cd /opt/modules/hbase-2.1.9/bin
[hadoop@centos01 bin]$ 

[hadoop@centos01 bin]$ ./start-hbase.sh 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/modules/hadoop-2.8.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/modules/hbase-2.1.9/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
running master, logging to /opt/modules/hbase-2.1.9/bin/../logs/hbase-hadoop-master-centos01.out
[hadoop@centos01 bin]$ jps
37889 HMaster
41891 Jps

五、测试

[hadoop@centos01 ~]$ sh /opt/modules/hbase-2.1.9/bin/hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/modules/hadoop-2.8.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/modules/hbase-2.1.9/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
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.9, rec4145ba5dc9cd30d4eb700bca2de2d08104207c, Tue Feb 11 03:49:57 UTC 2020
Took 0.0153 seconds                                                                                                              
hbase(main):001:0> list
TABLE                                                                                                                            
0 row(s)
Took 1.2388 seconds                                                                                                              
=> []
hbase(main):002:0> 
http://192.168.0.181:16010

技术图片

 

启动
sh /opt/modules/hbase-2.1.9/bin/start-hbase.sh

停止
sh /opt/modules/hbase-2.1.9/bin/stop-hbase.sh

连接
sh /opt/modules/hbase-2.1.9/bin/hbase shell

 

Hadoop 单机搭建 Hbase单机模式搭建

标签:自带   java_home   tfs   hba   and   data   png   idt   seconds   

原文地址:https://www.cnblogs.com/xuchen0117/p/12497668.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!