HBase简介及安装配置

HBase是什么?

  1. 数据库
  2. 非关系型数据库(NoSql)
  3. 强依赖于HDFS
  4. 按照BigTable论文思想开发
    1. 面向列来存储的
    2. 可以用来储存:“结构化”数据,以及”非结构化“数据
  5. 一个令新手程序员不爽的地方,只能全表扫描(最少要按照某一个区间(行建范围)扫描)

HBase的安装和配置

hbase-site.xml修改内容

<configuration>
    
    <property>     
        <name>hbase.rootdirname>     
        <value>hdfs://hadoop101:8020/hbasevalue>   
    property>

    <property>   
        <name>hbase.cluster.distributedname>
        <value>truevalue>
    property>

   
    <property>
        <name>hbase.master.portname>
        <value>16000value>
    property>
    
    <property>   
        <name>hbase.zookeeper.quorumname>
        <value>hadoop101:2181,hadoop102:2181,hadoop103:2181value>
    property>
    v
    <property>   
        <name>hbase.zookeeper.property.dataDirname>
     <value>/home/daxiong/modules/zookeeper-3.4.10/zkDatavalue>
    property>

configuration>

regionservers

hadoop101
hadoop102
hadoop103

HBase需要依赖的Jar包

​ 由于HBase需要依赖Hadoop,所以替换HBase的lib目录下的jar包,以解决兼容问题

  • 删除原有的jar(hbase安装目录下的lib文件夹下)
$ rm -rf /home/daxiong/modules/hbase-1.3.1/lib/hadoop-*
$ rm -rf /home/daxiong/modules/hbase-1.3.1/lib/zookeeper-3.4.6.jar
  • 拷贝新jar,涉及的jar有:
hadoop-annotations-2.7.2.jar
hadoop-auth-2.7.2.jar
hadoop-client-2.7.2.jar
hadoop-common-2.7.2.jar
hadoop-hdfs-2.7.2.jar
hadoop-mapreduce-client-app-2.7.2.jar
hadoop-mapreduce-client-common-2.7.2.jar
hadoop-mapreduce-client-core-2.7.2.jar
hadoop-mapreduce-client-hs-2.7.2.jar
hadoop-mapreduce-client-hs-plugins-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2-tests.jar
hadoop-mapreduce-client-shuffle-2.7.2.jar
hadoop-yarn-api-2.7.2.jar
hadoop-yarn-applications-distributedshell-2.7.2.jar
hadoop-yarn-applications-unmanaged-am-launcher-2.7.2.jar
hadoop-yarn-client-2.7.2.jar
hadoop-yarn-common-2.7.2.jar
hadoop-yarn-server-applicationhistoryservice-2.7.2.jar
hadoop-yarn-server-common-2.7.2.jar
hadoop-yarn-server-nodemanager-2.7.2.jar
hadoop-yarn-server-resourcemanager-2.7.2.jar
hadoop-yarn-server-tests-2.7.2.jar
hadoop-yarn-server-web-proxy-2.7.2.jar
zookeeper-3.4.5.jar

这些jar包的对应版本应替换成你目前使用的hadoop版本,具体情况具体分析。

查找jar包举例:

$ find /home/admin/modules/hadoop-2.7.2/ -name hadoop-annotations*

HBase软连接Hadoop配置

$ ln -s ~/modules/hadoop-2.7.2/etc/hadoop/core-site.xml ~/modules/hbase-1.3.1/conf/core-site.xml
$ ln -s ~/modules/hadoop-2.7.2/etc/hadoop/hdfs-site.xml ~/modules/hbase-1.3.1/conf/hdfs-site.xml

HBase远程scp到其他集群

$ scp -r /home/daxiong/modules/hbase-1.3.1/ hadoop102:/home/daxiong/modules/
$ scp -r /home/daxiong/modules/hbase-1.3.1/ hadoop103:/home/daxiong/modules/

如果使用的是JDK8以上版本,则应在hbase-evn.sh中移除“HBASE_MASTER_OPTS”和“HBASE_REGIONSERVER_OPTS”配置。

启动和关闭命令

  • 启动命令

    $ bin/start-hbase.sh
  • 关闭命令

    $ bin/stop-hbase.sh

HBase-1.3.1端口解释

启动成功后,可以通过“host:port”的方式来访问HBase管理页面,例如

http://hadoop101:16010 
  • 16000 master的默认通信地址
  • 16010 master的web页面地址
  • 16020 regionservice默认的通信地址
  • 16030 regionserver的web页面地址

你可能感兴趣的:(HBase)