安装Hadoop,参考:
http://www.cnblogs.com/LixingTie/archive/2012/06/27/2566521.html
安装Zookeeper,参考:
http://www.cnblogs.com/LixingTie/archive/2012/06/28/2566618.html
安装hbase
cd /home/hadoop/hbase
sudo wget http://mirror.bit.edu.cn/apache/hbase/stable/hbase-0.92.1.tar.gz # 下载hbase
tar xvzf hbase-0.92.1.tar.gz # 解压
ln -s hbase-0.92.1.tar.gz hbase # 建立软链接
sudo wget http://mirror.bit.edu.cn/apache/hbase/stable/hbase-0.92.1.tar.gz # 下载hbase
tar xvzf hbase-0.92.1.tar.gz # 解压
ln -s hbase-0.92.1.tar.gz hbase # 建立软链接
编辑/etc/profile,设置环境变量
#
hbase配置
export HBASE_HOME=/home/hadoop/hbase/hbase/
export PATH= $PATH: $HBASE_HOME/bin
export HBASE_HOME=/home/hadoop/hbase/hbase/
export PATH= $PATH: $HBASE_HOME/bin
hbase是基于hdfs的,hbase的配置主要涉及conf目录下的三个文件:hbase-env.sh,hbase-site.xml,regionservers。
编辑hbase-env.sh
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386
export HBASE_CLASSPATH=/home/hadoop/hadoop/conf
export HBASE_OPTS= " -XX:+UseConcMarkSweepGC "
export HBASE_MANAGES_ZK= true
export HBASE_CLASSPATH=/home/hadoop/hadoop/conf
export HBASE_OPTS= " -XX:+UseConcMarkSweepGC "
export HBASE_MANAGES_ZK= true
编辑hbase-site.xml
<?xml version=
"
1.0
"?>
<?xml-stylesheet type= " text/xsl " href= " 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>zookeeper</value>
</property>
</configuration>
<?xml-stylesheet type= " text/xsl " href= " 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>zookeeper</value>
</property>
</configuration>
修改regionservers
localhost
#
本机
启动hbase
start-hbase.sh
输入jps命令查看进程
NameNode
DataNode
Jps
HRegionServer
SecondaryNameNode
TaskTracker
JobTracker
QuorumPeerMain
HMaster
DataNode
Jps
HRegionServer
SecondaryNameNode
TaskTracker
JobTracker
QuorumPeerMain
HMaster