利用yum升级cdh hbase0.90至0.94(即chd3-》cdh4)

一. 集群布局

haoop06                thrift server、hbase master、zookeeper server

hadoop01~04      thrift server、hbase regionserver、zookeeper

hadoop07、hadoop08    thrift server、hbase regionserver、zookeeper


二. 编辑repository文件

# 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


三. 关闭并删除已有hbase

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


四. 安装cdh4版本的hbase

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


   
        hbase.rootdir
        hdfs://hadoop06.ihep.ac.cn:8008/hbase
        The directory shared by region servers and into
        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.
       

   

   
        hbase.master.port
        60000
        The port the HBase Master should bind to.
   

   
        hbase.cluster.distributed
        true
        The mode the cluster will be in. Possible values are
        false for standalone mode and true for distributed mode.  If
        false, startup will run all HBase and ZooKeeper daemons together
        in the one JVM.
       

   

   
        hbase.zookeeper.quorum
        hadoop06.ihep.ac.cn
        Comma separated list of servers in the ZooKeeper Quorum.
        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.
       

   

   
        hbase.zookeeper.sission.timeout
        60000
   

     
        hbase.zookeeper.property.clientPort
        2181
        Property from ZooKeeper's config zoo.cfg.
        The port at which the clients will connect.
       

   

   
        hbase.master
        hadoop06.ihep.ac.cn
   

   
        hbase.master.info.port
        60010
        The port for the HBase Master web UI.
        Set to -1 if you do not want a UI instance run.
       

   

   
        hbase.master.info.bindAddress
        0.0.0.0
        The bind address for the HBase Master web UI
       

   

   
        hbase.regionserver.lease.period
        60000
        HRegion server lease period in milliseconds. Default is
        60 seconds. Clients must report in within this period else they are
        considered dead.

   

   
        hbase.rpc.timeout
        60000
   

   
        hbase.rest.port
        60050
   

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路径

你可能感兴趣的:(软件安装)