首页 > 代码库 > Ubuntu环境下手动配置HBase

Ubuntu环境下手动配置HBase

配置HBase

前提:

配置Hadoop(http://www.cnblogs.com/xxx0624/p/4166095.html)

配置zoopkeeper(http://www.cnblogs.com/xxx0624/p/4168440.html)

1. 下载HBase

解压HBase

tar -zxvf hbase-0.98.8-hadoop2-bin.tar.gz

 然后移动到/home目录下,并重命名为hbase

 

2. 设置环境变量

#set hbase environmentexport HBASE_HOME=/home/hbase/export PATH=${HBASE_HOME}/bin:$PATH

 

3. 编辑hbase的配置

    3.1 hbase.sh

export HBASE_OPTS="-XX:+UseConcMarkSweepGC"export JAVA_HOME=/usr/lib/jvmexport HBASE_MANAGES_ZK=trueexport HBASE_CLASSPATH=/home/hbase/conf

    3.2 hbase-site.xml

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.mamicode.com/configuration.xsl"?><configuration>        <property>                <name>hbase.rootdir</name>                <value>hdfs://namenode/hbase</value>                <description>The directory shared by region servers.</description>        </property>        <property>                <name>hbase.master.port</name>                <value>60000</value>        </property>        <property>                <name>hbase.cluster.distributed</name>                <value>true</value>        </property>        <property>                <name>hbase.zookeeper.property.clientPort</name>                <value>2181</value>        </property>        <property>                <name>hbase.zookeeper.quorum</name>                <value>127.0.0.1</value>        </property></configuration>

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

<value>127.0.0.1</value>//注意这里和之前的zookeeper配的几个服务器地址是要相同的!

    3.3 regionservers

localhost

 

4. 启动HBase

start-hbase.sh  //进入bin文件夹

 

5. 检查是否成功

jps命令查询,如下所示:
NameNode
DataNode
Jps
HRegionServer
SecondaryNameNode
TaskTracker
JobTracker
QuorumPeerMain
HMaster

 

6. 测试

hbase shellcreate ‘test‘,‘cf‘

 

Ubuntu环境下手动配置HBase