HBase配置示例

2018-01-31 13:58 更新

基本分布式HBase安裝

在下文內(nèi)容中是一個(gè)分布式10節(jié)點(diǎn)的群集的基本配置示例:其中,節(jié)點(diǎn)被命名為example0,example1...一直到example9,在這個(gè)例子中;HBase Master和HDFS NameNode正在節(jié)點(diǎn)example0上運(yùn)行;RegionServers在節(jié)點(diǎn)example1- example9上運(yùn)行;一個(gè)3節(jié)點(diǎn)ZooKeeper集合運(yùn)行在example1、example2,以及example3的默認(rèn)端口上;ZooKeeper的數(shù)據(jù)被保存到:directory/export/zookeeper。

下面我們顯示在HBase conf目錄中找到的主要配置文件? -hbase-site.xml,regionservers和hbase-env.sh。

HBase-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>example1,example2,example3</value>
    <description>The directory shared by RegionServers.
    </description>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/export/zookeeper</value>
    <description>Property from ZooKeeper config zoo.cfg.
    The directory where the snapshot is stored.
    </description>
  </property>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://example0:8020/hbase</value>
    <description>The directory shared by RegionServers.
    </description>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
    <description>The mode the cluster will be in. Possible values are
      false: standalone and pseudo-distributed setups with managed ZooKeeper
      true: fully-distributed with unmanaged ZooKeeper Quorum (see hbase-env.sh)
    </description>
  </property>
</configuration>

regionservers

在此文件中列出將運(yùn)行RegionServers的節(jié)點(diǎn)。在我們的例子中,這些節(jié)點(diǎn)是example1- example9。

example1
example2
example3
example4
example5
example6
example7
example8
example9

hbase-env.sh

hbase-env.sh文件中的以下行顯示了如何設(shè)置JAVA_HOME環(huán)境變量(HBase需要的)并將堆設(shè)置為4 GB(而不是默認(rèn)值1 GB)。如果您復(fù)制并粘貼此示例,請(qǐng)務(wù)必調(diào)整JAVA_HOME以適合您的環(huán)境。

# The java implementation to use.
export JAVA_HOME=/usr/java/jdk1.8.0/

# The maximum amount of heap to use. Default is left to JVM default.
export HBASE_HEAPSIZE=4G

使用rsync將conf目錄的內(nèi)容復(fù)制到群集的所有節(jié)點(diǎn)。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)