CentOS 下HBase1.2.6 单机和 伪分布式平台搭建

前篇文章搭建了 hadoop

传送门  centos 上hadoop2.7.3安装部署 单机版

hbase 1.2.6 安装

一 hbase 安装

1. 下载解压

hbase 下载

解压到 /usr/hbase/

2. 修改环境

命令 :

vi /etc/profile
添加
export HBASE_HOME=/usr/hbase/hbase-1.2.6
#在path增加
:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HBASE_HOME/bin
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop

export HADOOP_MAPRED_HOME=${HADOOP_HOME}
export HADOOP_COMMON_HOME=${HADOOP_HOME}
export HADOOP_HDFS_HOME=${HADOOP_HOME}
export YARN_HOME=${HADOOP_HOME}
export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_HOME}/lib/natvie
export HADOOP_OPTS="-Djava.library.path=${HADOOP_HOME}/lib:${HADOOP_HOME}/lib/native"
 二、Hbase单机模式

1、修改配置文件/usr/hbase/hbase-1.2.6/conf/hbase-env.sh

去掉export前#号 修改

 export JAVA_HOME=/mnt/jdk1.8.0_151
export HBASE_MANAGES_ZK=true

 2、修改配置文件/usr/hbase/hbase-1.2.6/conf/hbase-site.xml


      
        hbase.rootdir
        file:/usr/hbase/hbase-tmp
    
<property>
         <name>hbase.zookeeper.property.dataDirname> 
           <value>/usr/hbase/data/zookeepervalue>
       property>
   

3、启动 Hbase

[root@node1 bin]# ./start-hbase.sh
遇到 jar 冲突问题 删除一个即可

[root@node1 bin]# ./start-hbase.sh
starting master, logging to /usr/hbase/hbase-1.2.6/logs/hbase-root-master-node1.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0

jps下多了一个HMaster进程  

[root@node1 sbin]# jps
15452 ResourceManager
15289 SecondaryNameNode
14978 NameNode
18111 Jps
15561 NodeManager
15079 DataNode
3933 HMaster
停止:
[root@node1 bin]# ./start-hbase.sh

单机安装完毕!

三 伪分布式安装

伪分布式和单机模式的区别主要是配置文件的不同

 1、修改配置文件/usr/hbase/hbase-1.2.6/conf/hbase-env.sh

 export JAVA_HOME=/mnt/jdk1.8.0_151
export HBASE_MANAGES_ZK=true
# export HBASE_CLASSPATH=   修改为
export HBASE_CLASSPATH=/usr/hadoop/hadoop-2.7.3/etc/hadoop
伪分布式zookeeper使用Hbase自带的即可。

2、修改配置文件 /usr/hbase/hbase-1.2.6/conf/hbase-site.xml


      
        hbase.rootdir
        hdfs://node1:9000/hbase
    
<property>
           <name>hbase.zookeeper.property.dataDirname> 
           <value>/usr/hbase/data/zookeepervalue>
 property>
  
     hbase.cluster.distributed
     true
 
  

3、启动Hbase

[root@node1 bin]# ./start-hbase.sh
localhost: starting zookeeper, logging to /usr/hbase/hbase-1.2.6/bin/../logs/hbase-root-zookeeper-node1.out
starting master, logging to /usr/hbase/hbase-1.2.6/logs/hbase-root-master-node1.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
starting regionserver, logging to /usr/hbase/hbase-1.2.6/logs/hbase-root-1-regionserver-node1.out

jps查看进程多了 HMaster和 HRegionServer   HQuorumPeer

[root@node1 sbin]# jps
15452 ResourceManager
18417 HMaster
15289 SecondaryNameNode
18564 HRegionServer
18347 HQuorumPeer
19075 Jps
14978 NameNode
15561 NodeManager
15079 DataNode
hbase shell 测试

[root@node1 bin]# ./hbase shell
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017

hbase(main):001:0> 
hbase(main):001:0> status
1 active master, 0 backup masters, 1 servers, 0 dead, 3.0000 average load
停止 hbase

[root@node1 bin]# ./stop-hbase.sh
stopping hbase..................
localhost: stopping zookeeper.

停止顺序 先停止hbase然后停止hadoop ,与之启动相反!



你可能感兴趣的:(hbase)