Hbase集群搭建
-
必须安装hadoop并且配置HADOOP_HOME
,因为HBase会按照该配置读取hdfs位置信息,启动HDFS(略)
-
必须安装zookeeper,并且保证zookeeper正常启动(集群安装).
-
安装配置HBASE
[root@CentOS ~]# tar -zxf hbase-1.2.4-bin.tar.gz -C /usr/
[root@CentOS ~]# vi .bashrc
`HBASE_MANAGES_ZK=false`
`HBASE_HOME=/usr/hbase-1.2.4`
HADOOP_HOME=/usr/hadoop-2.6.0
HADOOP_CLASSPATH=/root/mysql-connector-java-5.1.44.jar
JAVA_HOME=/usr/java/latest
PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:`$HBASE_HOME/bin`
CLASSPATH=.
export JAVA_HOME
export PATH
export CLASSPATH
export HADOOP_HOME
export HADOOP_CLASSPATH
`export HBASE_HOME`
`export HBASE_MANAGES_ZK`
[root@CentOS ~]# source .bashrc
[root@CentOS ~]# vi /usr/hbase-1.2.4/conf/hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://mycluster/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>CentOSA,CentOSB,CentOSC</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
</configuration>
[root@CentOS ~]# vi /usr/hbase-1.2.4/conf/regionservers
CentOSA
CentOSB
CentOSC
启动HBase
[root@CentOSX ~]# hbase-daemon.sh start master
[root@CentOSX ~]# hbase-daemon.sh start regionserver