HBase集群配置

集群环境:

centos6.5   master  192.168.145.129
centos6.5   slave1  192.168.145.130
centos6.5   slave2  192.168.145.136

配置步骤:

1.配置三台主机的hostname:(以192.168.145.129为例 其它的修改对应的hostname即可,重启系统后生效)

    vim /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=master  #修改成对应主机的hostname
    NETWORKING_IPV6=yes
    IPV6_AUTOCONF=no

2.配置三台主机的hosts文件内容如下:(集群节点hosts是一致的)

    127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    192.168.145.129 master
    192.168.145.130 slave1
    192.168.145.136 slave2

3.配置$HBASE_HOME/conf/hbase-env.sh文件

export JAVA_HOME=/home/work/jdk1.7.0export 
#不使用内置的zookeeper
HBASE_MANAGES_ZK=false   

4.配置$HBASE_HOME/confg/hbase-site.xml

<configuration>
        <property>
                <name>hbase.cluster.distributedname>
                <value>truevalue>
        property>
        <property>
                <name>hbase.rootdirname>
                <value>hdfs://master:9000/hbasevalue>
        property>
        <property>
                <name>hbase.zookeeper.quorumname>
                <value>master,slave1,slave2value>
        property>

configuration>

5.配置$HBASE_HOME/conf/regionservers文件

master
slave1
slave2

6.将$HBASE_HOME复制到slave1,slave2节点

scp /usr/local/hbase-0.98.18-hadoop2 root@slave1:/usr/local/hbase-0.98.18-hadoop2
scp /usr/local/hbase-0.98.18-hadoop2 root@slave2:/usr/local/hbase-0.98.18-hadoop2

7.启动HBase

[root@master hbase-0.98.18-hadoop2]# bin/start-hbase.sh
starting master, logging to /usr/local/hbase-0.98.18-hadoop2/bin/../logs/hbase-root-master-master.out
slave2: starting regionserver, logging to /usr/local/hbase-0.98.18-hadoop2/bin/../logs/hbase-root-regionserver-slave2.out
slave1: starting regionserver, logging to /usr/local/hbase-0.98.18-hadoop2/bin/../logs/hbase-root-regionserver-slave1.out
master: starting regionserver, logging to /usr/local/hbase-0.98.18-hadoop2/bin/../logs/hbase-root-regionserver-master.out

访问http://master:60010 如下则成功
HBase集群配置_第1张图片

你可能感兴趣的:(HBase,hbase,centos,集群)