HBASE实践

安装HBASE前需要先安装java和zookeeper

此处略过

 

到cdh5下载5.7.0对应的CDH安装包,解压

配置HBASE的环境变量

修改$HBASE_HOME/conf/hbase-env.sh

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home

修改$HBASE_HOME/conf/regionservers

子节点有哪些就填进去,类似于Hadoop的配置

 

修改$HBASE_HOME/conf/hbase-site.xml

<configuration>
  <property>
    <name>hbase.tmp.dir</name>
    <value>/Users/xiejundong/software/tmp/hbase</value>
  </property>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://notebook:8020/hbase</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>notebook:2181</value>
  </property>
</configuration>

启动

先启动依赖的dfs和zookeeper

然后启动hbase

xiejundongdeMacBook-Pro:hbase-1.2.0-cdh5.7.0 xiejundong$ start-dfs.sh 

xiejundongdeMacBook-Pro:hbase-1.2.0-cdh5.7.0 xiejundong$ zkServer.sh start

xiejundongdeMacBook-Pro:hbase-1.2.0-cdh5.7.0 xiejundong$ start-hbase.sh

查看进程

xiejundongdeMacBook-Pro:hbase-1.2.0-cdh5.7.0 xiejundong$ jps -m
915 RemoteMavenServer
871 
3288 SecondaryNameNode
3624 Jps -m
3193 DataNode
2042 QuorumPeerMain /Users/xiejundong/software/zookeeper-3.4.5-cdh5.7.0/bin/../conf/zoo.cfg
3451 HMaster start
3551 HRegionServer start
3119 NameNode

用webUI查看,默认在60010端口

http://127.0.0.1:60010/

HBASE实践