HBase的下载、安装与配置

来源:互联网 发布:数据库逻辑完整性 编辑:程序博客网 时间:2024/06/07 14:36

声明:作者原创,转载注明出处。

作者:帅气陈吃苹果

(一)安装

下载、解压:

wget http://mirror.bit.edu.cn/apache/hbase/1.3.1/hbase-1.3.1-bin.tar.gztar -zxvf hbase-1.3.1.tar.gz -C /root/hadoop/

(二)配置

cd $HBASE_HOME/conf
vim hbase-site.xml
1)单机模式
<!-- 指定HRegion服务器的位置,即数据存放位置  --><property>    <name>hbase.rootdir</name>    <value>file:///tmp/hbase-${user.name}/hbase</value></property>
2)伪分布式模式
<!-- 指定HRegion服务器的位置,即数据存放位置  --><property>    <name>hbase.rootdir</name>    <value>hdfs://localhost:9000/hbase</value></property><!-- 指定HLog和Hfile的副本个数  --><property>    <name>dfs.replication</name>    <value>1</value></property>
3)完全分布式模式
<!--  指定HRegion服务器的位置,即数据存放位置 --><property>    <name>hbase.rootdir</name>    <value>hdfs://master:9000/hbase</value></property><!-- 指定HBase运行模式,false表示单机模式或伪分布式,true表示完全分布式模式  --><property>    <name>hbase.clister.distributed</name>    <value>true</value></property><!-- 指定master位置  --><property>    <name>hbase.master</name>    <value>hdfs://master:60000</value></property><!--  指定zookeeper集群 --><property>    <name>hbase.zookeeper.quorum</name>    <value>master,slave1,slave2</value></property>

(三)运行

cd $HBASE_HOME/bin

1)单机模式
start-hbase.sh
2)伪分布式模式
start-dfs.shstart-hbase.sh
3)完全分布式模式
start-dfs.shzookeeper.sh startstart-hbase.sh