1. 程式人生 > >Macbook Hbase(1.2.6) 偽分布式安裝,Hadoop(2.8.2) ,使用自帶zookeeper

Macbook Hbase(1.2.6) 偽分布式安裝,Hadoop(2.8.2) ,使用自帶zookeeper

may use oop cab cto 電腦 nds log4j clu

首先需要保證hadoop已經在電腦上安裝。然後接下來只需要下載hhase配置就行了。

Step1: 下載hbase http://archive.apache.org/dist/hbase/1.2.6/ 選擇hbase-1.2.6-bin.tar.gz

Step2: 解壓hbase到指定目錄

Step3: 修改配置文件(進去conf文件夾下)

Step 3.1: hbase-env.sh

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

export HBASE_MANAGES_ZK=true // 這裏我使用的是hbase自帶的zookeper,所以需要將這個變量值設置為true

Step 3.2: hbase-site.xml

這裏hbase.rootdir中的路徑需要與hadoop core.site.xml中配置保持一致

<configuration>

  <property>
      <name>hbase.rootdir</name>
      <value>hdfs://localhost:9000/hbase</value>
  </property>
  <property>
      <name>hbase.cluster.distributed</name>
      <value>true</value>
  </property>
</configuration>

Step 4:啟動hhase

這裏需要先啟動hadoop,因為hbase要使用hadoop的hdfs服務

Step 4.1: 啟動hadoop

./start-all.sh

Step 4.2: 啟動hbase

./start-hbase.sh

Step 4.3:以上如果運行正常,使用jps將會看到以下界面。

27780 NameNode
27860 DataNode
28839 HMaster
4312 
29754 Jps
28941 HRegionServer
27965 SecondaryNameNode
28383 HQuorumPeer

Step 4.4: 訪問hbase shell測試下

Gogo:bin my$ ./hbase shell
2018-07-08 12:17:44,820 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/chong/opt/hbase-1.2.6/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/chong/opt/hadoop-2.8.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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.6, rUnknown, Mon May 29 02:25:32 CDT 2017

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

hbase(main):002:0> 

Macbook Hbase(1.2.6) 偽分布式安裝,Hadoop(2.8.2) ,使用自帶zookeeper