1. 程式人生 > >hbase 環境搭建

hbase 環境搭建

Hbase 環境搭建

Hbase 單機模式(Standalone )

官網下載 hbase 包

解壓到指定目錄

$ tar xzvf hbase-3.0.0-SNAPSHOT-bin.tar.gz

$ cd hbase-3.0.0-SNAPSHOT

 

在conf目錄下

配置檔案如下

配置hbase-env.sh中配置  JAVA_HOME

配置 hbase-site.xml

<configuration>

  <property>

    <name>hbase.rootdir</name>

    <value>file:///usr/local/software/tmp/hbase</value>

  </property>

  <property>

    <name>hbase.zookeeper.property.dataDir</name>

    <value>/usr/local/software/tmp/zookeeper</value>

  </property>

  <property>

    <name>hbase.unsafe.stream.capability.enforce</name>

    <value>false</value>

    <description>

      Controls whether HBase will check for stream capabilities (hflush/hsync).

 

      Disable this if you intend to run on LocalFileSystem, denoted by a rootdir

      with the 'file://' scheme, but be mindful of the NOTE below.

 

      WARNING: Setting this to false blinds you to potential data loss and

      inconsistent system state in the event of process and/or node failures. If

      HBase is complaining of an inability to use hsync or hflush it's most

      likely not a false positive.

    </description>

  </property>

</configuration>

 

啟動 bin 目錄

啟動服務  start-hbase.sh

關閉服務  stop-hbase.sh

 

Hbase 叢集模式

配置hbase-env.sh中配置JAVA_HOME和export HBASE_MANAGES_ZK=false

配置hbase-site.xml

<property>

<name>hbase.rootdir</name>

<value>hdfs://chenkl/hbase</value>

</property>

<property>

<name>hbase.cluster.distributed</name>

<value>true</value>

</property>

<property>

<name>hbase.zookeeper.quorum</name>

<value>node1,node2,node3</value>

</property>

配置reginservers,資料節點

vim reginservers

$ node1

$ node2

$ node3

在hbase-env.sh配置 export HBASE_CLASSPATH=/home/hadoop-2.5.1/etc/hadoop/,這裡是hadoop配置檔案的路徑

配置完成,分發到其他節點

需要的話配置環境變數

 

叢集驗證: http://node1:16010/master-status