共四台服务器
10.14.2.201(HMaster)
10.14.2.2021(HRegionServers)
backup-masters
10.14.2.203(HRegionServers)
backup-masters
10.14.2.204(HRegionServers)
backup-masters
hadoop版本1.2.1
zookeeper 版本3.4.5
hbase 版本0.94.18
1、安装部署java
2、安装部署hadoop1.2.1
3、安装部署zookeeper
http://blog.chinaunix.net/uid-25135004-id-4214399.html
安装部署配置hbase(在所有机器上执行)
4、解压hbase-0.94.18.tar.gz
tar xvf hbase-0.94.18.tar.gz -C /export/
cd /export/
ln -s hbase-0.94.18 hbase
5、配置hbase-env.sh
cd /export/hbase/conf
vim hbase-env.sh
-
export JAVA_HOME=/usr/java/jdk1.6.0_32/
-
export HBASE_MANAGES_ZK=false
HBASE_MANAGES_ZK false为使用独立的zookeeper,ture使用habase自带的zookeeper
6、配置hbase-site.xml
vim hbase-site.xml
-
-
-
hbase.rootdir
-
hdfs://10.14.2.201:9000/hbase
-
The directory shared byRegionServers.
-
-
-
-
hbase.cluster.distributed
-
true
-
The mode the clusterwill be in. Possible values are
-
false: standalone and pseudo-distributedsetups with managed Zookeeper
-
true: fully-distributed with unmanagedZookeeper Quorum (see hbase-env.sh)
-
-
-
-
hbase.zookeeper.property.clientPort
-
2181
-
Property fromZooKeeper's config zoo.cfg.
-
The port at which the clients willconnect.
-
-
-
-
hbase.zookeeper.quorum
-
10.14.2.201,10.14.2.202,10.14.2.203,10.14.2.204
-
Comma separated listof servers in the ZooKeeper Quorum.
-
For example,"host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
-
By default this is set to localhost forlocal and pseudo-distributed modes
-
of operation. For a fully-distributedsetup, this should be set to a full
-
list of ZooKeeper quorum servers. IfHBASE_MANAGES_ZK is set in hbase-env.sh
-
this is the list of servers which we willstart/stop ZooKeeper on.
-
-
-
-
hbase.zookeeper.property.dataDir
-
/export/zookeeper/data
-
Property fromZooKeeper's config zoo.cfg.
-
The directory where the snapshot isstored.
-
-
-
hbase.rootdir 为HDFS的NameNode的位置。 例如,你的namenode运行在10.14.2.201,端口是9000 你期望的hbase目录是 /hbase,配置:hdfs://10.14.2.201:9000/hbase
hbase.cluster.distributed :Hbase的运行模式。false是单机模式,true是分布式模式。若为false,Hbase和Zookeeper会运行在同一个JVM里面
hbase.zookeeper.property.clientPort:ZooKeeper的zoo.conf中的配置。 客户端连接的端口
hbase.zookeeper.quorum:Zookeeper集群的地址列表,用逗号分割。
hbase.zookeeper.property.dataDir:ZooKeeper 快照的存储位置
7、配置 regionservers
vim regionservers
-
10.14.2.202
-
10.14.2.203
-
10.14.2.204
配置你希望运行的全部 HRegionServer,一行写一个ip或者域名,这里的server会随着集群的启动而启动,集群的停止而停止。
8、配置backup-masters
为了保证HBase集群的高可靠性,HBase支持多Backup Master 设置。当Active Master挂掉后,Backup Master可以自动接管整个HBase的集群。
vim backup-masters
-
10.14.2.202
-
10.14.2.203
-
10.14.2.204
9、替换habase/lib 目录下的hadoop-core-1.0.4.jar包
rm -rf /export/hbase/lib/hadoop-core-1.0.4.jar
cp /export/hadoop/hadoop-core-1.2.1.jar /export/hbase/lib/
10、更改权限
chown hadoop.hadoop -R /export/hbase
chown hadoop.hadoop -R /export/hbase/
11、在10.14.2.201(HMaster)启动hbase
su - hadoop
[hadoop@master ~]$ /export/hbase/bin/start-hbase.sh
starting master, logging to /export/hbase/bin/../logs/hbase-hadoop-master-master.hadoop.out
10.14.2.202: starting regionserver, logging to /export/hbase/bin/../logs/hbase-hadoop-regionserver-slave1.hadoop.out
10.14.2.203: starting regionserver, logging to /export/hbase/bin/../logs/hbase-hadoop-regionserver-slave2.hadoop.out
10.14.2.204: starting regionserver, logging to /export/hbase/bin/../logs/hbase-hadoop-regionserver-slave3.hadoop.out
12、执行jps查看服务
10.14.2.201(HMaster)上执行
[hadoop@master ~]$ jps
30660 Jps
5192 SecondaryNameNode
4898 JobTracker
30483 HMaster
4716 NameNode
10.14.2.202(HRegionServers)上执行
[hadoop@slave1 ~]$ jps
21937 Jps
16740 QuorumPeerMain
14967 DataNode
15073 TaskTracker
21722 HRegionServer
21793 HMaster
10.14.2.203(HRegionServers)上执行
[root@slave2 hadoop]# su - hadoop
[hadoop@slave2 ~]$ jps
21471 HMaster
21627 Jps
15384 TaskTracker
15277 DataNode
21399 HRegionServer
16460 QuorumPeerMain
10.14.2.204(HRegionServers)上执行
[hadoop@slave3 ~]$ jps
16294 QuorumPeerMain
30910 HMaster
29893 DataNode
30839 HRegionServer
29987 TaskTracker
31071 Jps
13、进入hbase 无异常抛出
[hadoop@master ~]$ /export/hbase/bin/hbase shell
HBase Shell; enter 'help
' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.94.18, r1577788, Sat Mar 15 04:46:47 UTC 2014
hbase(main):001:0> list
TABLE
0 row(s) in 1.1330 seconds
hbase(main):002:0>
14、通过WEB页面来管理查看HBase数据库。
HMaster:
15、此时hbase 安装部署配置完毕
阅读(7960) | 评论(0) | 转发(0) |