配置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 environment export 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/jvm export HBASE_MANAGES_ZK=true export HBASE_CLASSPATH=/home/hbase/conf
3.2 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>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 shell create ‘test‘,‘cf‘
时间: 2024-10-23 05:44:08