安装hbase集群

来源:互联网 发布:qq for linux ubuntu 编辑:程序博客网 时间:2024/06/04 18:31

安装hbase集群

(1)前置文章

1.redhat上安装hadoop2
(http://blog.csdn.net/huanghuazsp/article/details/43837453)
2.redhat上安装hadoop2集群
(http://blog.csdn.net/huanghuazsp/article/details/43865623)

(2)下载hbase

本文使用的是hbase-0.98.6.1-hadoop2-bin.tar.gz
(http://pan.baidu.com/s/1c0pj89U)
解压到me目录下

(3)安装zookeeper

1.下载zookeeper
这里使用的是zookeeper-3.4.6.tar.gz
(http://pan.baidu.com/s/1gdKl9Nt)
2.配置zoo.cfg

# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial# synchronization phase can takeinitLimit=10# The number of ticks that can pass between# sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just# example sakes.dataDir=/me/zk/datadataLogDir=/me/zk/log# the port at which the clients will connectclientPort=2181server.1=main:28888:38888server.2=node1:28888:38888server.3=node2:28888:38888## Be sure to read the maintenance section of the# administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1

/me/zk/data
添加文件 myid
内容3台机器分别为
1
2
3

3.分别启动3个节点
cd /me/zookeeper-3.4.6/bin
./zkServer.sh start

4.查看各个节点的状态
./zkServer.sh status

(4)安装

1.修改所有节点的/me/hbase-0.98.6.1-hadoop2/conf/regionservers
为:
main
node1
node2

2.修改所有节点的/me/hbase-0.98.6.1-hadoop2/conf/hbase-site.xml
为:

<configuration> <property>   <name>hbase.rootdir</name>   <value>hdfs://main:9000/usr/hbase/data</value> </property> <property>   <name>hbase.hregion.max.filesize</name>   <value>1073741824</value> </property> <property>   <name>hbase.hregion.memstore.flush.size</name>   <value>134217728</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>zookeeper.session.timeout</name>   <value>120000</value> </property> <property>   <name>hbase.zookeeper.property.tickTime</name>   <value>6000</value> </property>   <property>     <name>hbase.zookeeper.quorum</name>     <value>main,node1,node2</value></property><property>       <name>hbase.tmp.dir</name>       <value>/me/hbase/tmpdata</value>   </property></configuration>

3.修改所有节点的/me/hbase-0.98.6.1-hadoop2/conf/hbase-env.sh
为:

export HBASE_OPTS="$HBASE_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"export JAVA_HOME=/me/jdk1.7.0_67export HBASE_MANAGES_ZK=trueexport HBASE_HOME=/me/hbase-0.98.6.1-hadoop2export HADOOP_HOME=/me/hadoop-2.4.1

4.启动
cd /me/hbase-0.98.6.1-hadoop2
./bin/start-hbase.sh

5.进入hbase
./bin/hbase shell

6.查看表
list
这里写图片描述

0 0
原创粉丝点击