1、由于刚搭建hbase,对hbase还不是很熟悉,可能由于hbase和hadoop版本都是分别进行发布和管理的,因此在进行hbase搭建和测试的时候,可能经常出现一些问题,因此建议在搭建环境的时候,建议hbase下所使用的lib库,涉及到hadoop的全部使用hadoop目录下的lib库。
2、安装
1、准备tar包 hbase-0.94.9.tar.gz
2、准备环境变量
[master-/hadoop/hbase/conf]ls
hadoop-metrics.properties hbase-env.sh hbase-policy.xml hbase-site.xml log4j.properties regionservers
3、修改参数,主要为hbase-env.sh,hbase-site.xml和regionservers几个文件
修改hbase-env.sh
export JAVA_HOME=/hadoop/jdk
export HBASE_HOME=/hadoop/hbase
export PATH=$PATH:$HBASE_HOME/bin
export HBASE_OPTS="$HBASE_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"
export HADOOP_HOME=/hadoop/hadoop
修改hbase-site.xml
[master-/hadoop/hbase-config]cat hbase-site.xml
hbase.rootdir
hdfs://master:54310/hbase
hbase.cluster.distributed
true
hbase.master
master
hbase.zookeeper.quorum
master,node1,node2
hbase.tmp.dir
/hadoop/hbase/tmp
3、修改regionservers文件
[master-/hadoop/hbase-config]cat regionservers
node1
node2
master
4、设置hbase自己的zookeeper
[master-/hadoop/hbase-config]cat zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/hadoop/hbase/zookeeper/data
# the port at which the clients will connect
clientPort=2181
#
# 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
server.1=node1:2888:3888
server.2=node2:2888:3888
server.3=master:2888:3888
4、配置文件设置好了
scp 命令复制到每个节点对应的目录下
scp hbase* node1:/hadoop/
scp hbase* node2:/hadoop/
5、启动hbase
[master-/hadoop/hbase/bin]./start-hbase.sh
启动之后,检查每个节点的regionserver日志和zookeeper日志,以及主节点下的master等日志,如果都没有问题,检查hbase是否成功
检查hbase master
检查hbase regionserver
6、检查hbase操作
hbase(main):001:0> create 'dsg','data'
0 row(s) in 1.4240 seconds
hbase(main):003:0> scan 'dsg'
ROW COLUMN+CELL
0 row(s) in 0.0170 seconds
阅读(3460) | 评论(0) | 转发(0) |