Hbase單機&僞分佈式部署

單機部署

[hadoop@hadoop004 software]$ wget http://archive.cloudera.com/cdh5/cdh/5/hbase-1.2.0-cdh5.12.0.tar.gz

[hadoop@hadoop004 software]$ tar -zxf hbase-1.2.0-cdh5.12.0.tar.gz -C ~/app/

[hadoop@hadoop004 software]$ cd ~/app/hbase-1.2.0-cdh5.12.0/
[hadoop@hadoop004 conf]$ vim hbase-env.sh

export JAVA_HOME=/usr/java/jdk1.8.0_144/
[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ mkdir -p tmp/hbasedata

[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ mkdir -p tmp/zkdata
<!--[hadoop@hadoop004 conf]$ vim hbase-site.xml-->

<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>file:///home/hadoop/app/hbase-1.2.0-cdh5.12.0/hbasedata</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/hadoop/app/hbase-1.2.0-cdh5.12.0/zkdata</value>
  </property>
  <property>
    <name>hbase.unsafe.stream.capability.enforce</name>
    <value>false</value>
  </property>
</configuration>
[hadoop@hadoop004 conf]$ vim ~/.bash_profile

export HBASE_HOME=/home/hadoop/app/hbase-1.2.0-cdh5.12.0
export PATH=$HBASE_HOME/bin:$PATH

[hadoop@hadoop004 conf]$ source ~/.bash_profile
hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ bin/start-hbase.sh
[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ bin/hbase shell

2019-06-05 17:53:21,984 INFO  [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/hbase-1.2.0-cdh5.12.0/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.6.0-cdh5.7.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.0-cdh5.12.0, rUnknown, Thu Jun 29 04:37:42 PDT 2017

hbase(main):001:0>
hbase(main):002:0* quit

僞分佈式部署

對照着官網html

[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ vim conf/hbase-site.xml
<property>
    <name>hbase.unsafe.stream.capability.enforce</name>
    <value>true</value>
  </property>
<property>
  <name>hbase.cluster.distributed</name>
  <value>true</value>
</property>
<property>
  <name>hbase.rootdir</name>
  <value>hdfs://hadoop004:9000/hbase</value>
</property>
<property>
  <name>hbase.zookeeper.quorum</name>
  <value>hadoop004:2181</value>
</property>
[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ vim conf/hbase-env.sh
#添加
export HBASE_MANAGES_ZK=false

啓動java

[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ bin/start-hbase.sh

Hbase單機&僞分佈式部署

成功!!!shell

補充vim

僞分佈式安裝的時候並非一路順風的,可是遇到問題必定不能慌,經過查找日誌來排查問題bash

問題復現app

Hbase單機&僞分佈式部署
經過start-hbase.sh腳本啓動Hbase,而後jps發現HMaster並無啓動分佈式

此時,查看HMaste的日誌輸出
Hbase單機&僞分佈式部署ide

並無有用的信息oop

[hadoop@hadoop004 hbase-1.2.0-cdh5.12.0]$ tail -200 /home/hadoop/app/hbase-1.2.0-cdh5.12.0/logs/hbase-hadoop-master-hadoop004.log

Hbase單機&僞分佈式部署

問題就是出如今紅框框這裏,ui

解決方案,在hbase-site.xml文件
Hbase單機&僞分佈式部署
搞定!!!

還有一開始,啓動Hbase的時候會默認使用Hbase自帶的ZooKeeper,但此時因爲個人機子已經啓動了ZooKeeper,而且佔用了2181端口,因此也HMaster也啓動失敗了

解決方案
Hbase單機&僞分佈式部署

Hbase單機&僞分佈式部署搞定!!!

相關文章
相關標籤/搜索