haoop06 thrift server、hbase master、zookeeper server
hadoop01~04 thrift server、hbase regionserver、zookeeper
hadoop07、hadoop08 thrift server、hbase regionserver、zookeeper
# vi /etc/yum.repos.d/cloudera-cdh4.repo
[cloudera-cdh4]
name=Cloudera's Distribution for Hadoop, Version 4
baseurl=http://archive.cloudera.com/cdh4/redhat/5/x86_64/cdh/4/
gpgkey = http://archive.cloudera.com/cdh4/redhat/5/x86_64/cdh/RPM-GPG-KEY-cloudera
gpgcheck = 1
或到以下网址去下载所需的repo文件
http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH-Version-and-Packaging-Information/cdhvd_topic_2.html
1. 停止thrift server和clients,停止集群
# service hadoop-hbase-thrift stop
# service hadoop-hbase-master stop
# service hadoop-hbase-regionserver stop
2. 停止zookeeper server
# service hadoop-zookeeper-server stop
3. 将zookeeper从cdh3升级至cdh4
(1)删除zookeeper
# service hadoop-zookeeper-server stop (hadoop06 only)
# yum remove hadoop-zookeeper-server (hadoop06 only)
# yum remove hadoop-zookeeper
(2)安装zookeeper基础包
# yum install zookeeper
(3)安装zookeeper server
# yum install zookeeper-server (hadoop06 only)
(4)编辑/etc/zookeeper/conf/zoo.cfg文件
# vi /etc/zookeeper/conf/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.
dataDir=/var/zookeeper
# the port at which the clients will connect
clientPort=2181
server.0=hadoop06.ihep.ac.cn:2888:3888
(5)启动zookeeper server
1. 安装hbase
# yum install hbase
2. 安装master (hadoop06 only)
# yum install hbase-master
3. 安装regionserver (except hadoop06)
# yum install hbase-regionserver
4. 安装thriftserver
# yum install hbase-thrift
5. 安装hbase-rest
# yum install hbase-rest
6. 配置hbase-site.xml文件 (cdh4的该文件位于/etc/hbase/conf.dist/目录下,将该目录下的文件拷贝到/etc/hbase/conf下)
# vi /etc/hbase/conf/hbase-site.xml
which HBase persists. The URL should be 'fully-qualified'
to include the filesystem scheme. For example, to specify the
HDFS directory '/hbase' where the HDFS instance's namenode is
running at namenode.example.org on port 9000, set this value to:
hdfs://namenode.example.org:9000/hbase. By default HBase writes
into /tmp. Change this configuration else all data will be lost
on machine restart.
false for standalone mode and true for distributed mode. If
false, startup will run all HBase and ZooKeeper daemons together
in the one JVM.
For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
By default this is set to localhost for local and pseudo-distributed modes
of operation. For a fully-distributed setup, this should be set to a full
list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
this is the list of servers which we will start/stop ZooKeeper on.
The port at which the clients will connect.
Set to -1 if you do not want a UI instance run.
60 seconds. Clients must report in within this period else they are
considered dead.
# vi /etc/hbase/conf/regionservers
hadoop01.ihep.ac.cn
hadoop02.ihep.ac.cn
hadoop03.ihep.ac.cn
hadoop04.ihep.ac.cn
hadoop07.ihep.ac.cn
hadoop08.ihep.ac.cn
7. 启动hbase
# service zookeeper-server start
# service hbase-master
# service hbase-regionserver
# service hbase-thrift
8. 命令调整
# mv /usr/bin/hbase /usr/bin/hbase.bak (或将其删除)
# export PATH=$PATH:/usr/lib/hbase/bin (或将其写入~/.bash_profile文件中)
9. 测试安装是否成功(任选其一即可)
(1)打开http://hadoop06.ihep.ac.cn:60010/master-status网页
(2)hbase shell
查看hadoop版本:hadoop version
手动更新locate数据库:updatedb
yum查询已安装软件:yum list installed
启动图形界面:/usr/sbin/gdm start
查看hdfs中文件大小:hadoop fs -du hdfs路径