【HBase】05-HBase配置样例

正如在Hadoop中向hdfs-site.xml文件添加特定于站点的HDFS配置一样,对于HBase,特定于站点的定制进入文件conf/hbase-site.xml。有关可配置属性的列表,请参阅下面的hbase默认配置,或在src/main/resources处查看HBase源代码中的原始hbase-default.xml源文件。
并非所有配置选项都能使其符合hbase-default.xml。一些配置只出现在源代码中;识别这些更改的唯一方法是通过代码检查。
当前,这里的更改将要求HBASE重新启动群集以注意更改。

基本分布式HBase安装

下面是一个分布式十节点集群的基本配置示例:节点命名为example0、example1到example9等。HBase Master和HDFS NameNode运行在example0节点上。RegionServers运行在example1-example9节点上。一个三个节点的ZooKeeper集群使用默认端口运行在example1, example2, example3上. * ZooKeepe数据存储在目录/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

在这个文件中,列出运行区域服务器的节点。在我们的例子中,这些节点是example1-example9.

example1
example2
example3
example4
example5
example6
example7
example8
example9

hbase-env.sh

hbase-env.sh文件中的下列行显示了如何设置JAVA_HOME环境变量(HBase所需的)并将堆设置为4GB(而不是默认值1GB)。如果您复制并粘贴此示例,请确保调整JAVA_HOME以适应您的环境。

# 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命令拷贝文件到集群中所有的节点。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值